title = $title; $this->message = $message; $this->buttonName = $buttonName; $this->buttonURL = $buttonURL; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return [WebPushChannel::class]; } /** * Get the web-push representation of the notification. * * @param mixed $notifiable * @return NotificationChannels\WebPush\WebPushMessage */ public function toWebPush($notifiable) { $data = DB::table('basic_settings')->select('notification_image')->first(); $notificationImage = $data->notification_image; return (new WebPushMessage) ->icon('./assets/img/' . $notificationImage) ->title($this->title) ->body($this->message) ->action($this->buttonName, $this->buttonURL); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ // ]; } }