Support the ongoing development of Laravel.io →
Views Blade
Last updated 2 years ago.
0

Recently found out about this package and it is awesome. Since than i include it in every new project by default :)

Last updated 2 years ago.
0

There is also Basset which is no longer maintained . But there is also Asset Pipeline

Last updated 2 years ago.
0

revati said:

Recently found out about this package and it is awesome. Since than i include it in every new project by default :)

So I'm looking through Assets, and I see they have a Collections feature, where you can group files together and call them. I'm guessing this is what I would use to call the appropriate scripts? I could just say Assets::add('[page_name]') and it would call all the appropriate scripts for that page. Where would I put the collections code though?

Also, I want all the JavaScript to be placed at the bottom of the page right before the closing body tag. Does Assets take care of this?

Thanks!

Last updated 2 years ago.
0

Place those in your views to include required assets

{{ Assets::js() }} // For js
{{ Assets::css() }} // For css

You should publish its configuration files and there you can define your custom collections

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.