Does anybody know how to get the variables working inside the Mardown template files?
Use variables inside the Markdown Mailables
Hello,
I've created a new mailable by following the guide on: https://laravel.com/docs/5.4/mail#markdown-mailables
Inside the default layout, the name of the application is used inside the header of the mail. I would like to replace the application name with an image of the logo. Therefore i've exported the Markdown mail components with:
php artisan vendor:publish --tag=laravel-mail
Inside the view of the mail i've added a public property
public function __construct(Visit $visit)
{
$this->visit = $visit;
}
This variable is working inside the Markdown file that is used to create the body of the email message.
However, I can't seem to pass the variable into the resources/views/vendor/mailfiles. I doesn't matter if i'm using the layout.blade.php or header.blade.php files.
After adding the $visitvariable inside one of those two files, i'm getting a Undefined variable: visit error.
Is there a different way to add variables to both the header and footer inside the Markdown template files?
Please or to participate in this conversation.