2019-11-05 23:51:39 +01:00
|
|
|
<?php
|
2020-07-08 14:02:16 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-07-08 14:02:16 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
2019-11-05 23:51:39 +01:00
|
|
|
|
|
|
|
namespace App\Events\Payment\Methods;
|
|
|
|
|
|
|
|
use App\Models\ClientGatewayToken;
|
2020-07-08 14:02:16 +02:00
|
|
|
use App\Models\Company;
|
2019-11-05 23:51:39 +01:00
|
|
|
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 MethodDeleted
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var ClientGatewayToken
|
|
|
|
*/
|
|
|
|
private $payment_method;
|
|
|
|
|
2020-06-30 01:35:17 +02:00
|
|
|
public $company;
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2020-07-08 14:02:16 +02:00
|
|
|
public $event_vars;
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2019-11-05 23:51:39 +01:00
|
|
|
/**
|
|
|
|
* Create a new event instance.
|
|
|
|
*
|
|
|
|
* @param ClientGatewayToken $payment_method
|
2020-10-28 11:10:49 +01:00
|
|
|
* @param Company $company
|
|
|
|
* @param array $event_vars
|
2019-11-05 23:51:39 +01:00
|
|
|
*/
|
2020-07-08 14:02:16 +02:00
|
|
|
public function __construct(ClientGatewayToken $payment_method, Company $company, array $event_vars)
|
2019-11-05 23:51:39 +01:00
|
|
|
{
|
|
|
|
$this->payment_method = $payment_method;
|
2020-06-30 01:35:17 +02:00
|
|
|
$this->company = $company;
|
2020-09-06 11:38:10 +02:00
|
|
|
$this->event_vars = $event_vars;
|
2019-11-05 23:51:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the channels the event should broadcast on.
|
|
|
|
*
|
2020-10-28 11:10:49 +01:00
|
|
|
* @return Channel|array
|
2019-11-05 23:51:39 +01:00
|
|
|
*/
|
|
|
|
public function broadcastOn()
|
|
|
|
{
|
|
|
|
return new PrivateChannel('channel-name');
|
|
|
|
}
|
|
|
|
}
|