SuperRedEvent.php 977 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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\Models\Users;
  11. class SuperRedEvent
  12. {
  13. use Dispatchable, InteractsWithSockets, SerializesModels;
  14. /**
  15. * Create a new event instance.
  16. *
  17. * @return void
  18. */
  19. public $user;
  20. public $money;
  21. public $scale;
  22. public function __construct($user,$money,$scale)
  23. {
  24. $this->money = $money;
  25. $this->scale = $scale;
  26. $this->user = $user;
  27. }
  28. /**
  29. * Get the channels the event should broadcast on.
  30. *
  31. * @return \Illuminate\Broadcasting\Channel|array
  32. */
  33. public function broadcastOn()
  34. {
  35. return new PrivateChannel('channel-name');
  36. }
  37. }