| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace App\Notifications;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Notifications\Messages\BroadcastMessage;
- use Illuminate\Notifications\Notification;
- use Illuminate\Support\Facades\Log;
- 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);
- }
- }
|