AgentIncome.php 955 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Modules\Finance\Events;
  3. use Illuminate\Support\Facades\Log;
  4. use Illuminate\Broadcasting\Channel;
  5. use Illuminate\Queue\SerializesModels;
  6. use Illuminate\Broadcasting\PrivateChannel;
  7. use Illuminate\Broadcasting\PresenceChannel;
  8. use Illuminate\Foundation\Events\Dispatchable;
  9. use Illuminate\Broadcasting\InteractsWithSockets;
  10. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  11. class AgentIncome
  12. {
  13. use Dispatchable, InteractsWithSockets, SerializesModels;
  14. public $data;
  15. /**
  16. * Create a new event instance.
  17. *
  18. * @return void
  19. */
  20. public function __construct($data)
  21. {
  22. Log::error(json_encode($data));
  23. Log::info('123111');
  24. $this->data=$data;
  25. }
  26. /**
  27. * Get the channels the event should broadcast on.
  28. *
  29. * @return \Illuminate\Broadcasting\Channel|array
  30. */
  31. public function broadcastOn()
  32. {
  33. return new PrivateChannel('channel-name');
  34. }
  35. }