<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class VerifyEmailNotification extends Notification implements ShouldQueue
{
use Queueable;
protected $token;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($token)
{
$this->token = $token;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject(config('constants.title') . ' - Please Verify Your Email')
->line('You are receiving this email because you have sign up on ' . config('constants.title') . '.')
->action('Verify Email', url(config('app.url').route('verify_email', ['token' => $this->token], false)))
->line('If you did not sign up on ' . config('constants.title') . ', no further action is required.');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
我正在使用 Laravel 5.5 的电子邮件通知功能。我已更改了此邮件通知,但某些地方它被缓存了。我的应用程序向我发送带有旧内容的邮件,而不是我在这里分享的当前代码片段。我正在使用 supervisor 监控队列进程。
我已经运行以下命令清除视图缓存,但它并没有起作用。
php artisan view:clear
我也重新启动了队列
php artisan queue:restart
我也曾经跑过
php artisan config:cache
但是似乎没有什么方法对我有效。
这个问题可能与主管有关吗?