After upgrading a Laravel project to PHP8 I'm getting this error pretty often:
Passing an $environment into the "League\CommonMark\CommonMarkConverter" constructor is deprecated in 1.6 and will not be supported in 2.0; use MarkdownConverter instead
The stack trace shows it's triggered by this line in a cached view file:
<?php echo e(Illuminate\Mail\Markdown::parse($slot)); ?>
I have deleted all cached views multiple times (I thought that there were maybe some old cached ones in there) but that didn't solve it.
Not sure if this should be an error that's reported as it might be the case that this is fixed in the Laravel framework, but before upgrading to PHP8 I never had this error so I think it's related to that.
Banged my head on this one quite a bit too. I kept making changes to the markdown files, but they never showed up - almost like Laravel was pointing to the wrong place. And it was...
I was working on an upgraded Laravel application (I.E. I started with 5.x and have upgraded over time), and thus there are two potential issues.
First, in
ip/config/mail.php
: you may have to actually create the markdown path. If you published the mailables prior to markdown, the entire markdown mail settings are missing. You can pull them from the git repo, or from here for convenience:Second potential (though less likely in your case) issue if you published these mail files earlier, the Laravel layouts file in the HTML directory has the
or
operator, which will choke. Change these three operators to??
.Maybe this will help you, depending on where you started :)