Event.php 603 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Events;
  3. use Illuminate\Broadcasting\Channel;
  4. use Illuminate\Broadcasting\InteractsWithSockets;
  5. use Illuminate\Broadcasting\PrivateChannel;
  6. use Illuminate\Foundation\Events\Dispatchable;
  7. use Illuminate\Queue\SerializesModels;
  8. class Event {
  9. use Dispatchable, InteractsWithSockets, SerializesModels;
  10. /**
  11. * Create a new event instance.
  12. *
  13. * @return void
  14. */
  15. public function __construct() {
  16. //
  17. }
  18. /**
  19. * Get the channels the event should broadcast on.
  20. *
  21. * @return Channel|array
  22. */
  23. public function broadcastOn() {
  24. return new PrivateChannel('channel-name');
  25. }
  26. }