Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Events;
  4.  
  5. use App\Product;
  6. use Illuminate\Broadcasting\Channel;
  7. use Illuminate\Queue\SerializesModels;
  8. use Illuminate\Broadcasting\PrivateChannel;
  9. use Illuminate\Broadcasting\PresenceChannel;
  10. use Illuminate\Foundation\Events\Dispatchable;
  11. use Illuminate\Broadcasting\InteractsWithSockets;
  12. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  13.  
  14. class NewCategory
  15. {
  16.     use Dispatchable, InteractsWithSockets, SerializesModels;
  17.     public $category;
  18.  
  19.     /**
  20.      * Create a new event instance.
  21.      *
  22.      * @param Product $category
  23.      */
  24.     public function __construct(Product $category)
  25.     {
  26.         $this->category = $category;
  27.     }
  28.  
  29.     /**
  30.      * Get the channels the event should broadcast on.
  31.      *
  32.      * @return \Illuminate\Broadcasting\Channel|array
  33.      */
  34.     public function broadcastOn()
  35.     {
  36.         return new PrivateChannel('channel-name');
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement