Laravel package to automatically create files for RequireJS. This is for my personal use but if there is anyone who wants to use this package, feel free to fork it.
Install the package using composer. Edit your composer.json
file and require this.
"panugaling/require-js": "dev-master"
Next is to update composer
from the terminal.
composer update
Let's now add the Service Provider
by opening your app/config/app.php
and add a new item in the providers array.
'Panugaling\RequireJS\RequireJSServiceProvider',
If you want to change the configuration of the package, type this command in the terminal.
php artisan config:publish panugaling/require-js
That's it! You are now ready to use the package.
In your blade template, you can use it like this.
<body>
{{ Required::load('main') }}
</body>
The argument main
is the filename of our main js file. you can change it what ever you like.