OrderNotification.php 863 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Events;
  3. use Illuminate\Broadcasting\PrivateChannel;
  4. use Illuminate\Queue\SerializesModels;
  5. use Illuminate\Foundation\Events\Dispatchable;
  6. use Illuminate\Broadcasting\InteractsWithSockets;
  7. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  8. class OrderNotification implements ShouldBroadcast
  9. {
  10. use Dispatchable, InteractsWithSockets, SerializesModels;
  11. public $resto_id;
  12. public $message;
  13. /**
  14. * Create a new event instance.
  15. *
  16. * @return void
  17. */
  18. public function __construct($resto_id)
  19. {
  20. $this->resto_id = $resto_id;
  21. $this->message = "New Order is placed";
  22. }
  23. /**
  24. * Get the channels the event should broadcast on.
  25. *
  26. * @return Channel|array
  27. */
  28. public function broadcastOn()
  29. {
  30. return new PrivateChannel('meem-order-production');
  31. }
  32. }