Php Laravel 5.7-降价通知未声明的变量异常
我最近从Laravel 5.6升级到了5.7 我通过添加新变量更新了降价通知视图模板,如下所示:Php Laravel 5.7-降价通知未声明的变量异常,php,notifications,markdown,laravel-5.7,Php,Notifications,Markdown,Laravel 5.7,我最近从Laravel 5.6升级到了5.7 我通过添加新变量更新了降价通知视图模板,如下所示: $mailMessage = (new MailMessage) ->from('no-reply@xyz.com', 'xyz company') ->subject('xyz subject') ->markdown('emails.news-alert', [ 'url' => 'www.xyz.c
$mailMessage = (new MailMessage)
->from('no-reply@xyz.com', 'xyz company')
->subject('xyz subject')
->markdown('emails.news-alert', [
'url' => 'www.xyz.com',
'articles' => $this->articles
]);
return $mailMessage;
在查看电子邮件。新闻提醒中,我有以下信息:
<a href='{{ $url }}'>{{ $url }}</a>
我已尝试清除缓存,但仍出现以下错误:
php artisan view:clear
php artisan cache:clear
知道为什么会这样吗
奇怪的是,如果我按如下方式预览通知,它会显示良好:
Route::get('/notification', function () {
$articles = App\Article::paginate(2);
$message = (new App\Notifications\NewsNotification($articles))->toMail(Auth::user());
$markdown = new Markdown(view(), config('mail.markdown'));
return $markdown->render('emails.news-alert', $message->data());
});
重新启动队列:工作人员似乎已将其修复。遇到了相同的问题,此问题已修复。奇怪的
Route::get('/notification', function () {
$articles = App\Article::paginate(2);
$message = (new App\Notifications\NewsNotification($articles))->toMail(Auth::user());
$markdown = new Markdown(view(), config('mail.markdown'));
return $markdown->render('emails.news-alert', $message->data());
});