TestEvent.php 716 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Module\Game\Events;
  3. use App\Module\Game\Models\Test;
  4. use Illuminate\Broadcasting\InteractsWithSockets;
  5. use Illuminate\Foundation\Events\Dispatchable;
  6. use Illuminate\Queue\SerializesModels;
  7. class TestEvent
  8. {
  9. use Dispatchable, InteractsWithSockets, SerializesModels;
  10. /**
  11. * 测试数据
  12. *
  13. * @var Test
  14. */
  15. public Test $test;
  16. /**
  17. * 事件类型
  18. *
  19. * @var string
  20. */
  21. public string $type;
  22. /**
  23. * 创建事件实例
  24. *
  25. * @param Test $test
  26. * @param string $type
  27. * @return void
  28. */
  29. public function __construct(Test $test, string $type)
  30. {
  31. $this->test = $test;
  32. $this->type = $type;
  33. }
  34. }