pratiksh404 /
adminetic
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Pratiksh\Adminetic\Events; |
||
| 4 | |||
| 5 | use Illuminate\Broadcasting\InteractsWithSockets; |
||
| 6 | use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow; |
||
| 7 | use Illuminate\Foundation\Events\Dispatchable; |
||
| 8 | use Illuminate\Queue\SerializesModels; |
||
| 9 | |||
| 10 | class PushNotificationEvent implements ShouldBroadcastNow |
||
| 11 | { |
||
| 12 | use Dispatchable, InteractsWithSockets, SerializesModels; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 13 | |||
| 14 | public $message; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Create a new event instance. |
||
| 18 | * |
||
| 19 | * @return void |
||
| 20 | */ |
||
| 21 | public function __construct($message) |
||
| 22 | { |
||
| 23 | $this->message = $message; |
||
| 24 | } |
||
| 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 ['push_notification']; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function broadcastAs() |
||
| 37 | { |
||
| 38 | return 'push-notification-event'; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |