NewOrder.php 875 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Events;
  3. use Illuminate\Broadcasting\Channel;
  4. use Illuminate\Broadcasting\InteractsWithSockets;
  5. use Illuminate\Broadcasting\PresenceChannel;
  6. use Illuminate\Broadcasting\PrivateChannel;
  7. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  8. use Illuminate\Foundation\Events\Dispatchable;
  9. use Illuminate\Queue\SerializesModels;
  10. class NewOrder
  11. {
  12. use Dispatchable, InteractsWithSockets, SerializesModels;
  13. public $data;
  14. /**
  15. * Create a new event instance.
  16. *
  17. * @return void
  18. */
  19. public function __construct($data)
  20. {
  21. Log:info('1231231231231111@@@');
  22. $this->data=$data;
  23. }
  24. /**
  25. * Get the channels the event should broadcast on.
  26. *
  27. * @return \Illuminate\Broadcasting\Channel|array
  28. */
  29. public function broadcastOn()
  30. {
  31. return new PrivateChannel('channel-name');
  32. }
  33. }