blessing-skin-server/app/Notifications/SiteMessage.php

57 lines
1.0 KiB
PHP
Raw Normal View History

2019-07-03 16:19:13 +08:00
<?php
declare(strict_types=1);
namespace App\Notifications;
2019-07-05 22:48:23 +08:00
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
2019-12-14 11:10:37 +08:00
use Illuminate\Notifications\Notification;
2019-07-03 16:19:13 +08:00
2019-07-05 22:48:23 +08:00
class SiteMessage extends Notification implements ShouldQueue
2019-07-03 16:19:13 +08:00
{
2019-07-05 22:48:23 +08:00
use Queueable;
2019-07-03 16:19:13 +08:00
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.
*
2019-12-14 11:10:37 +08:00
* @param mixed $notifiable
*
2019-07-03 16:19:13 +08:00
* @return array
*/
public function via($notifiable)
{
return ['database'];
}
/**
* Get the array representation of the notification.
*
2019-12-14 11:10:37 +08:00
* @param mixed $notifiable
*
2019-07-03 16:19:13 +08:00
* @return array
*/
public function toArray($notifiable)
{
return [
'title' => $this->title,
'content' => $this->content,
];
}
}