ctrlpanel/app/Notifications/DynamicNotification.php

68 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
class DynamicNotification extends Notification
{
use Queueable;
/**
2021-08-02 22:10:59 +00:00
* @var array
*/
2021-08-02 22:10:59 +00:00
private $via;
/**
2021-08-02 22:10:59 +00:00
* @var array
*/
2021-08-02 22:10:59 +00:00
private $database;
2021-08-02 22:10:59 +00:00
/**
* @var MailMessage
*/
private $mail;
/**
* Create a new notification instance.
*
* @param array $via
* @param array $database
* @param MailMessage $mail
*/
2021-08-02 22:10:59 +00:00
public function __construct($via, $database, $mail)
{
2021-08-02 22:10:59 +00:00
$this->via = $via;
$this->database = $database;
$this->mail = $mail;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via()
{
2021-08-02 22:10:59 +00:00
return $this->via;
}
2021-08-02 22:10:59 +00:00
public function toMail()
{
return $this->mail;
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray()
{
2021-08-02 22:10:59 +00:00
return $this->database;
}
}