for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: alive
* Date: 12/11/17
* Time: 7:55 AM
*/
namespace Alive2212\LaravelModelEventService\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
class BaseModelEvent
{
use Dispatchable, InteractsWithSockets, SerializesModels;
* @var
protected $model;
* Create a new event instance.
* @param $model
public function __construct($model)
$this->model = $model[0];
}
* Get the channels the event should broadcast on.
*
* @return PrivateChannel
public function broadcastOn()
return new PrivateChannel('channel-name');
* @return mixed
public function getModel()
return $this->model;
* @param mixed $model
public function setModel($model)
$this->model = $model;