update notification

This commit is contained in:
Mathieu Lagace
2020-07-27 16:41:28 -04:00
parent c16d1e7e95
commit 2d64d6d422
28 changed files with 1167 additions and 47 deletions

View File

@@ -0,0 +1,65 @@
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class ScheduleNotification extends Notification
{
use Queueable;
protected String $name;
protected String $msg;
protected String $url;
protected String $icon;
/**
* Create a new notification instance.
*
* @param String $name
* @param String $msg
* @param String $url
*/
public function __construct(String $name,String $msg,String $url)
{
$this->name = $name;
$this->msg = $msg;
$this->url = $url;
$this->icon = '<i class="far fa-calendar"></i>';
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['database','broadcast'];
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
'name' => $this->name,
'msg' => $this->msg,
'url' => $this->url,
'icon' => $this->icon
];
}
public function broadcastType()
{
return 'notification.schedule';
}
}