| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Module\Game\Events;
- use App\Module\Game\Models\Test;
- use Illuminate\Broadcasting\InteractsWithSockets;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- class TestEvent
- {
- use Dispatchable, InteractsWithSockets, SerializesModels;
- /**
- * 测试数据
- *
- * @var Test
- */
- public Test $test;
- /**
- * 事件类型
- *
- * @var string
- */
- public string $type;
- /**
- * 创建事件实例
- *
- * @param Test $test
- * @param string $type
- * @return void
- */
- public function __construct(Test $test, string $type)
- {
- $this->test = $test;
- $this->type = $type;
- }
- }
|