mscharl / laravel-page-mix
Parses mix-manifest.json to automatically implement the Javascript named after the current route.
Installs: 1 147
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.0
- illuminate/filesystem: ^5.0,<5.5
- illuminate/routing: ^5.0,<5.5
- illuminate/support: ^5.0,<5.5
This package is not auto-updated.
Last update: 2020-01-24 16:40:44 UTC
README
This package parses your mix-manifest.json
to automatically implement the
Javascript named after the current route.
Setup
Add the service provider to the config/app.php
provider array
MScharl\LaravelPageMix\Provider\LaravelPageMixProvider::class,
Use pageMix()
instead of mix('page.js')
<script src="{{ pageMix() }}"></script>
Config
Publish the config file by executing the following command:
php artisan vendor:publish --provider=MScharl\\LaravelPageMix\\Provider\\LaravelPageMixProvider
It allows to configure a default file path if the route does not match any file name