who are you sending the mail to?
Laravel 5.5 won't render email with PHP 7.4
I am trying to render an email in Laravel 5.5, but no matter what I do, I get the following error on render:
ErrorException (E_NOTICE) Trying to access array offset on value of type null
happens in \vendor\egulias\email-validator\EmailValidator\Parser\Parser.php
I am running php 7.4 and I believe the error does NOT happen on php 7.3.
web.php:
Route::get('scratch', function(){
$mail = new Test();
return $mail->render();
});
Test.php
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class Test extends Mailable
{
use Queueable, SerializesModels;
public $subscription;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct()
{
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('emails.test');
}
}
test.blade.php
Hello from world
I'm thinking this has to be an issue with Laravel 5.5 and PHP 7.4. I can change my version but I'd like to avoid that if possible. Upgrading Laravel won't work for this application.
@snapey looks like a composer update fixed it. I'm always nervous of that solution on legacy apps but whatever lol
Please or to participate in this conversation.