mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Broadcasts / websockets
This commit is contained in:
parent
05829451b3
commit
f79bdf141b
@ -23,7 +23,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
/**
|
/**
|
||||||
* Class ClientWasArchived.
|
* Class ClientWasArchived.
|
||||||
*/
|
*/
|
||||||
class ClientWasArchived implements ShouldBroadcast
|
class ClientWasArchived
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ class ClientWasArchived implements ShouldBroadcast
|
|||||||
* @return Channel|array
|
* @return Channel|array
|
||||||
*/
|
*/
|
||||||
public function broadcastOn()
|
public function broadcastOn()
|
||||||
{nlog("broadcasting");
|
{
|
||||||
return new PrivateChannel('channel-name');
|
return new PrivateChannel('channel-name');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,13 +14,17 @@ namespace App\Events\Invoice;
|
|||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Broadcasting\PrivateChannel;
|
||||||
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class InvoiceWasCreated.
|
* Class InvoiceWasCreated.
|
||||||
*/
|
*/
|
||||||
class InvoiceWasCreated
|
class InvoiceWasCreated implements ShouldBroadcast
|
||||||
{
|
{
|
||||||
use SerializesModels;
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Invoice
|
* @var Invoice
|
||||||
@ -44,4 +48,15 @@ class InvoiceWasCreated
|
|||||||
$this->company = $company;
|
$this->company = $company;
|
||||||
$this->event_vars = $event_vars;
|
$this->event_vars = $event_vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the channels the event should broadcast on.
|
||||||
|
*
|
||||||
|
* @return PrivateChannel|array
|
||||||
|
*/
|
||||||
|
public function broadcastOn()
|
||||||
|
{
|
||||||
|
return new PrivateChannel('channel-name');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user