Looking to hire Laravel developers? Try LaraJobs

laravel-vuex-resapi maintained by codegor

Description
A laravel part of Vuex-laravel-resource-api for web socket events.
Author
Last update
2019/09/16 15:20 (dev-master)
License
Downloads
1

Comments
comments powered by Disqus

Codegor/laravel-vuex-resapi

Laravel Source Build Status License Total Downloads

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.

How to use?

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.