AddService.php 743 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Modules\Manager\Events;
  3. use App\Models\Admin;
  4. use Illuminate\Queue\SerializesModels;
  5. use Illuminate\Broadcasting\PrivateChannel;
  6. use Illuminate\Foundation\Events\Dispatchable;
  7. use Illuminate\Broadcasting\InteractsWithSockets;
  8. class AddService
  9. {
  10. use Dispatchable, InteractsWithSockets, SerializesModels;
  11. /**
  12. * Create a new event instance.
  13. *
  14. * @return void
  15. */
  16. public $user;
  17. public function __construct(Admin $user)
  18. {
  19. $this->user = $user;
  20. }
  21. /**
  22. * Get the channels the event should broadcast on.
  23. *
  24. * @return \Illuminate\Broadcasting\Channel|array
  25. */
  26. public function broadcastOn()
  27. {
  28. return new PrivateChannel('channel-name');
  29. }
  30. }