DeliveryAppointmentEvent.php 902 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Events;
  3. use App\DeliveryAppointmentCar;
  4. use Illuminate\Broadcasting\Channel;
  5. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  6. use Illuminate\Foundation\Events\Dispatchable;
  7. use Illuminate\Queue\SerializesModels;
  8. class DeliveryAppointmentEvent implements ShouldBroadcast
  9. {
  10. use Dispatchable, SerializesModels;
  11. public $delivery;
  12. /**
  13. * Create a new event instance.
  14. *
  15. * @param DeliveryAppointmentCar $delivery
  16. *
  17. * @return void
  18. */
  19. public function __construct(DeliveryAppointmentCar $delivery)
  20. {
  21. $this->delivery = $delivery;
  22. }
  23. /**
  24. * Get the channels the event should broadcast on.
  25. *
  26. * @return \Illuminate\Broadcasting\Channel|array
  27. */
  28. public function broadcastOn()
  29. {
  30. return new Channel('delivery');
  31. }
  32. public function broadcastAs()
  33. {
  34. return "car";
  35. }
  36. }