1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-06 03:02:34 +01:00
invoiceninja/app/Events/Company/CompanyWasDeleted.php
Benjamin Beganović fbf9f39cc6
Remove 'documents' when company is deleted (#3462)
* Remove 'documents' when company is deleted

* Fix Codacy warnings
2020-03-10 07:05:23 +11:00

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');
}
}