2018-10-01 00:32:33 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Events;
|
|
|
|
|
|
|
|
use \App\Item;
|
2021-05-20 23:37:35 +00:00
|
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
2018-10-01 00:32:33 +00:00
|
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
2022-11-14 00:04:45 +00:00
|
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
2018-10-01 00:32:33 +00:00
|
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
2021-05-20 23:37:35 +00:00
|
|
|
use Illuminate\Queue\SerializesModels;
|
2018-10-01 00:32:33 +00:00
|
|
|
|
|
|
|
class ReturnItem
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
2022-11-14 00:04:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Item
|
|
|
|
*
|
|
|
|
* @var Item
|
|
|
|
*/
|
2018-10-01 00:32:33 +00:00
|
|
|
public $item;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new event instance.
|
|
|
|
*
|
2018-10-10 03:46:28 +00:00
|
|
|
* @param Item $item The returned item.
|
2021-05-20 23:37:35 +00:00
|
|
|
*
|
2018-10-01 00:32:33 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct(Item $item)
|
|
|
|
{
|
|
|
|
$this->item = $item;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the channels the event should broadcast on.
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Broadcasting\Channel|array
|
|
|
|
*/
|
|
|
|
public function broadcastOn()
|
|
|
|
{
|
2022-11-14 00:04:45 +00:00
|
|
|
return new PrivateChannel('touchedItem');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function broadcastAs()
|
|
|
|
{
|
|
|
|
return 'ReturnItem';
|
2018-10-01 00:32:33 +00:00
|
|
|
}
|
|
|
|
}
|