mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-06 04:28:27 +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 int $days;
|
|
|
|
public function __construct(int $expire_days)
|
|
{
|
|
$this->days = $expire_days;
|
|
}
|
|
|
|
public function via($notifiable)
|
|
{
|
|
return sysConfig('account_expire_notification');
|
|
}
|
|
|
|
public function toMail($notifiable): MailMessage
|
|
{
|
|
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): array
|
|
{
|
|
return [
|
|
'days' => $this->days,
|
|
];
|
|
}
|
|
|
|
public function toCustom($notifiable): array
|
|
{
|
|
return [
|
|
'title' => trans('notification.account_expired'),
|
|
'content' => trans('notification.account_expired_content', ['days' => $this->days]),
|
|
];
|
|
}
|
|
}
|