One Hat Cyber Team
Your IP :
18.217.91.21
Server IP :
192.145.235.60
Server :
Linux ngx365.inmotionhosting.com 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 30 09:45:56 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
centos12
/
bizcento.com
/
app
/
Notifications
/
Edit File:
PushDemo.php
<?php namespace App\Notifications; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use NotificationChannels\WebPush\WebPushMessage; use NotificationChannels\WebPush\WebPushChannel; class PushDemo extends Notification { use Queueable; public $title; public $message; public $buttonText; public $buttonURL; public $icon; /** * Create a new notification instance. * * @return void */ public function __construct($title, $message, $buttonText, $buttonURL, $icon) { $this->title = $title; $this->message = $message; $this->buttonText = $buttonText; $this->buttonURL = $buttonURL; $this->icon = $icon; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return [WebPushChannel::class]; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toWebPush($notifiable, $notification) { $push = (new WebPushMessage) ->title($this->title) ->icon($this->icon) ->action($this->buttonText, $this->buttonURL); if (!empty($this->message)) { $push = $push->body($this->message); } return $push; } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ // ]; } }
Simpan