I have a .js file in my Modules\ModuleName\Assets folder. I want to use it in other module's views files. How i can to include it in html.
Like so:
{{ Module::asset('blog:js/script.js') }}
This assumes your script is located at /Modules/ModuleName/Assets/js/script.js. If it is not in a folder, just omit the js/ part in the asset call.
(Found here.)
Using the Module::asset('blog:js/script.js') function just gives me a 404 error when attempting to link to the files. I'm running this on artisan serve.
Did you publish your module assets ? (command in the docs as well)
oh, thx a lot)
Hi, how can we handle assets files ?
In fact I use Bower and would like to copy all assets from the bower_components directory instead of Assets directory.
Modules/OwlCarousel2
---bower.json
---Assets
---bower_components
It's more simple I think to update only the bower.json and call the publish command
Thanks for your help
Please help me to publish module assets?
I tried Module::asset('blog:js/script.js') function just gives me a 404 error.
Thanks.
Run php artisan module:publish.
Hi nWidart,
Thank you for your help. I run the publish command, it says published but still it is not working.
My full line of code is:
File is inside Modules/Lab/Assets/css/style.css
Thanks
Thanks @nWidart for your quick while, I tried again and looks good now.
prayas daai malai css ra js , image haru Module ko vitra raakhnu pareko kasari solve garnu vayo
Thanks @nWidart for your quick while, I tried again and looks good now.
how can you solved it please help me
@nWidart please can you tell me command to publish assets
Most helpful comment
Run
php artisan module:publish.