mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-06 20:50:01 +00:00
49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class AccountExpire extends Notification implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
private $days;
|
|
|
|
public function __construct($expired_at)
|
|
{
|
|
$this->days = now()->diffInDays($expired_at);
|
|
}
|
|
|
|
public function via($notifiable)
|
|
{
|
|
return sysConfig('account_expire_notification');
|
|
}
|
|
|
|
public function toMail($notifiable)
|
|
{
|
|
return (new MailMessage)
|
|
->subject(trans('notification.account_expired'))
|
|
->line(trans('notification.account_expired_content', ['days' => $this->days]))
|
|
->action(trans('notification.view_web'), url('/'));
|
|
}
|
|
|
|
public function toDataBase($notifiable)
|
|
{
|
|
return [
|
|
'days' => $this->days,
|
|
];
|
|
}
|
|
|
|
public function toCustom($notifiable)
|
|
{
|
|
return [
|
|
'title' => trans('notification.account_expired'),
|
|
'content' => trans('notification.account_expired_content', ['days' => $this->days]),
|
|
];
|
|
}
|
|
}
|