Download the PHP package laravel-frontend-presets/stimulus without Composer
On this page you can find all versions of the php package laravel-frontend-presets/stimulus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-frontend-presets/stimulus
More information about laravel-frontend-presets/stimulus
Files in laravel-frontend-presets/stimulus
Package stimulus
Short Description Laravel 5.5+ frontend preset for Stimulus
License MIT
Informations about the package stimulus
Laravel 5.5+ frontend preset for Stimulus
This package makes it easy to use Stimulus, a modest JavaScript framework for the HTML you already have, with Laravel 5.5+.
Read more on the origin of Stimulus.
Contents
- Installation/Usage
- Options
- Contributing
- Credits
- License
Installation/Usage
To install this preset on your Laravel application, simply run:
This will:
- Add the Stimulus preset package
- Remove JavaScript files other than
bootstrap.js
- Add JavaScript files for leveraging Stimulus
- Install Node.js dependencies
- Build frontend assets
Once complete, ensure that the built js/app.js
file in your public
directory is loaded in a Blade layout or view, e.g.:
The Stimulus controllers defined in resources/assets/js/controllers
(or resources/js/controllers
for Laravel 5.7+) will be available at runtime.
Note: After updating your defined Stimulus controllers, remember to rebuild your frontend assets to reflect your changes.
Your Stimulus controllers will be included in your project automatically via Webpack's require.context
feature and a Stimulus helper. If you're not using Laravel Mix or other Webpack-based build tools, review the Stimulus Handbook for alternative integration steps.
Stimulus operates based on HTML data attributes, so update your view(s) to make use of your defined Stimulus controllers. For the default hello-controller
, the necessary HTML would look similar to:
Learn more about Stimulus by reading the handbook and/or reference.
Options
-
with-turbolinks
- Adds Turbolinks to make navigating your web application faster.Example:
Contributing
Please check our contributing rules in our website for details.
Credits
- Shane Logsdon
- All Contributors
License
This project is licensed under the MIT License. See LICENSE for details.