bfg/puller-alpine is a Laravel package for a description for puller-alpine..
It currently has 0 GitHub stars and 14 downloads on Packagist (latest version 1.0.0).
Install it with composer require bfg/puller-alpine.
Discover more Laravel packages by bfg
or browse all Laravel packages to compare alternatives.
Last updated
composer require bfg/puller-alpine
Navigate the link to read the documentation in the https://github.com/bfg-s/puller.
Make sure that in your public/vendor folder published puller-alpine/puller-alpine.js.
He had to appear immediately after installing the package,
as it broads publications in the laravel-assets group.
If this did not happen and you did not appear there, publish it manually:
php artisan vendor:publish --tag=puller-alpine-assets
Connect the script in your document after Alpine initialization:
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
<script src="{{ asset('vendor/puller-alpine/puller-alpine.js') }}"></script>
All events and their values are stored in the Alpine store.
If the store is passivated, then the first call will create a new
one if you want to use default states, use assistants for blade
or create shops manually.
<script>
document.addEventListener('alpine:init', () => {
Alpine.store('dark_mode', {
status: true,
toggle() { // <-- details
this.status = !this.status;
}
})
})
</script>
Details come to the function, or if this property will be assigned to it.
With Alpine blade directive:
@alpineStore('test', ['state' => true])
@alpineStore([
'chat' => ['list' => []],
'online' => ['count' => 0],
])
Generated:
<script type='text/javascript'>document.addEventListener('alpine:init', function () {Alpine.store("test", {"state":true});})</script>
<script type='text/javascript'>document.addEventListener('alpine:init', function () {Alpine.store("chat", {"list":[]});Alpine.store("online", {"count":0});})</script>
For send Messages
$message('event-name', {my: 'data'})
Store with last error list
Store with last error message
Store with last puller status code ( 0 - is normal)
Please see CHANGELOG for more information what has changed recently.
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.