| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace App\Notifications;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Notifications\Messages\BroadcastMessage;
- use Illuminate\Notifications\Notification;
- class RoutineNotification extends Notification implements ShouldQueue
- {
- use Queueable;
- /** @var array|mixed $seeLog */
- private $seeLog;
- public function __construct(array $seeLog)
- {
- $seeLog["no"] = $seeLog["id"];
- unset($seeLog["id"]);
- $this->seeLog = $seeLog;
- }
- /**
- * Get the notification's delivery channels.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function via($notifiable):array
- {
- return ['broadcast'];
- }
- public function viaQueues():array
- {
- return [
- 'broadcast' => 'notification-broadcast',
- ];
- }
- public function broadcastType():string
- {
- return 'common';
- }
- public function toBroadcast($notifiable):BroadcastMessage
- {
- return new BroadcastMessage($this->seeLog);
- }
- }
|