Advertisement
vitareinforce

ScheduleBroadcast

Mar 17th, 2025
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Events;
  4.  
  5. use Illuminate\Broadcasting\Channel;
  6. use Illuminate\Broadcasting\InteractsWithSockets;
  7. use Illuminate\Broadcasting\PresenceChannel;
  8. use Illuminate\Broadcasting\PrivateChannel;
  9. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  10. use Illuminate\Foundation\Events\Dispatchable;
  11. use Illuminate\Queue\SerializesModels;
  12.  
  13. use Illuminate\Support\Facades\Log;
  14.  
  15. class ScheduleBroadcast implements ShouldBroadcast
  16. {
  17. use Dispatchable, InteractsWithSockets, SerializesModels;
  18.  
  19. public $message;
  20.  
  21. /**
  22. * Create a new event instance.
  23. *
  24. * @return void
  25. */
  26. public function __construct($message)
  27. {
  28. Log::info($message);
  29. $this->message = $message;
  30. }
  31.  
  32. /**
  33. * Get the channels the event should broadcast on.
  34. *
  35. * @return \Illuminate\Broadcasting\Channel|array
  36. */
  37. public function broadcastOn()
  38. {
  39. Log::info("BroadcastOn");
  40. return new Channel('spls-schedule-broadcast');
  41. }
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement