This is a laravel event part of Vuex API library for Laravel REST Controller, with model example. When you want to use Laravel Echo with vuex-laravel-resource-api this is a backend for broadcasting event of Laravel Echo.
In a model at the boot section you can emmit WS event for Resapi.
Like this:
//...
use Codegor\Resapi\Events\UpdateData;
class Manager extends Model {
protected static function boot() {
// ...
static::saved(function($m){broadcast(new UpdateData('manager', $m->user_id))->toOthers();});
}
// ...
}
See example/Manager.php for fool example.