Example #1
0
 public static function boot()
 {
     parent::boot();
     Project::updating(function ($project) {
         $msg = "<a href='/projects/{$project->id}'>The project: {$project->name} was updated.</a>";
         Redis::lpush('messages', $msg);
         Redis::publish('new-message', $msg);
     });
     Project::creating(function ($project) {
         $msg = "<a href='/projects/{$project->id}'>The project: {$project->name} was created.</a>";
         Redis::lpush('messages', $msg);
         Redis::publish('new-message', $msg);
     });
 }