在Laravel邮件模板中定义的$slot变量在哪里?
<tr>
<td class="header">
<a href="{{ $url }}" style="display: inline-block;">
@if (trim($slot) === 'Laravel')
<img src="https://api.foo.com/foo-logo.svg" class="logo" alt="Laravel Logo">
@else
{{ $slot }}
@endif
</a>
</td>
</tr>我是通过以下方式使用的:
public function toMail($notifiable)
{
return (new MailMessage)
->subject(__('Reset Password Notification'))
->line(__('You are receiving this email because we received a password reset request for your account.'))
->action(__('Reset Password'), $this->url)
->line(__('This password reset link will expire in :count minutes.', ['count' => 60]))
->line(__('If you did not request a password reset, no further action is required.'));
}发布于 2022-05-17 10:09:52
所有邮件模板都存储在resources/views/email中。也许在这个目录中搜索一个短语$slot。
还检查可邮件类(MailMessage),其中->view('email.contact-form')方法指向…
就我而言,我有:
return $this
->from(config('mail.contact.address'))
->replyTo($senderEmail, $senderName)
->view('email.contact-form')
->with($data);邮件模板是:src/resources/views/email/contact-form.blade.php
https://stackoverflow.com/questions/66353083
复制相似问题