Downloads
Stars
Version
composer require bfg/emitter
Set in you RouteServiceProvider
router connection:
\Route::emitter();
For using with any guard use:
\Route::emitter('sanctum');
@emitterScripts();
<!-- OR --->
@emitterScripts($options);
Possible options is:
For request configuring.
$message('my-event', {});
Message is a signed request for an event.
What to transmit the names of the events and
at the same time not to transmit its full
range of names, the system is looking for
nesting in any space that is compiled depending
on your security guard, the default is web
So your nesting prefix will be the next WebMessage
And all created and declared Events and will cause them
consistently if there will be several events in one name.
Event search occurs on the following pattern:
Send name:
my-event
ormy
;Called Event:
*
\WebMessage\MyEvent
Send name:
actions:my-event
oractions:my
;Called Event:
*
\WebMessageActions\MyEvent
*
- Maybe any value.
Vue.mixin(VueMessageMutator);
Messages are supported by AlpineJS by default.
You can create a method with the name access
in the event class, which is executed before performing an event, but after its design.
...
public function access() {
return \Auth::check() && \Auth::user()->isAdmin()
}
...
You can declare a property or method named resource
, he must return the resource class that needs to be applied to the last truthful listener's result.
...
public $resource = UserResource::class;
// OR
public function resource() {
return UserResource::class;
}
...
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.