blessing-skin-server/app/Notifications/SiteMessage.php
2019-07-05 22:48:23 +08:00

55 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
class SiteMessage extends Notification implements ShouldQueue
{
use Queueable;
public $title;
public $content;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(string $title, $content = '')
{
$this->title = $title;
$this->content = $content;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['database'];
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
'title' => $this->title,
'content' => $this->content,
];
}
}