Sample-Laravel-Repository/app/Events/CompanyRegistered.php
kris@sentientgeeks.com 501a8e18e0 initial commit
2021-02-08 19:09:14 +05:30

34 lines
810 B
PHP

<?php
namespace App\Events;
use App\Company;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class CompanyRegistered
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $company;
public function __construct(Company $company)
{
$this->company = $company;
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new PrivateChannel('company-registered');
}
}