You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
866 B

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