Laravel — 在瀏覽器預覽Notifications Email(How to preview your emails notifications in browser — Laravel)






Photo by Krsto Jevtic on Unsplash


Laravel 5.6

Route::get('preview-email', function () {
$order = App\Models\Order::first();
$message = (new App\Notifications\OrderPaid($order))
->toMail($order->user);
$markdown = new Illuminate\Mail\Markdown(
view(),
config('mail.markdown'));
return $markdown->render($message->markdown, $message->data());});

Laravel > 5.8

Route::get('preview-email', function () {
$order = App\Models\Order::first();
return (new App\Notifications\OrderPaid($order))
->toMail($order->user);
});
Route::get('preview-email', function () {
$order = App\Models\Order::first();
$message = (new App\Notifications\OrderPaid($order))
->toMail($order->user);
return $message->render();});

留言

這個網誌中的熱門文章

什麼是QEMU ? 什麼是KVM ? 什麼是QEMU-KVM?

[Mac OSX] 如何關閉開機啟動的應用程式?