mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-06 03:02:34 +01:00
fbf9f39cc6
* Remove 'documents' when company is deleted * Fix Codacy warnings
43 lines
946 B
PHP
43 lines
946 B
PHP
<?php
|
|
|
|
namespace App\Events\Company;
|
|
|
|
use App\Models\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 CompanyWasDeleted
|
|
{
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
|
/**
|
|
* @var Company
|
|
*/
|
|
public $company;
|
|
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @param Company $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('channel-name');
|
|
}
|
|
}
|