revert commit

This commit is contained in:
m.razaghi
2026-08-20 17:32:09 +03:30
parent 76d9246e0e
commit 641332e5ba
6 changed files with 69 additions and 88 deletions

View File

@@ -1,32 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class MatchEnded implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $matchId;
public function __construct($matchId)
{
$this->matchId = $matchId;
}
public function broadcastOn()
{
// ارسال پیام به کانال پرایوت بازی که هر دو نفر داخل آن هستند
return new PrivateChannel('pvp-match.' . $this->matchId);
}
public function broadcastAs()
{
return 'match.ended';
}
}
//
//namespace App\Events;
//
//use Illuminate\Broadcasting\InteractsWithSockets;
//use Illuminate\Broadcasting\PrivateChannel;
//use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
//use Illuminate\Foundation\Events\Dispatchable;
//use Illuminate\Queue\SerializesModels;
//
//class MatchEnded implements ShouldBroadcastNow
//{
// use Dispatchable, InteractsWithSockets, SerializesModels;
//
// public $matchId;
//
// public function __construct($matchId)
// {
// $this->matchId = $matchId;
// }
//
// public function broadcastOn()
// {
// // ارسال پیام به کانال پرایوت بازی که هر دو نفر داخل آن هستند
// return new PrivateChannel('pvp-match.' . $this->matchId);
// }
//
// public function broadcastAs()
// {
// return 'match.ended';
// }
//}