laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.2k stars 10.89k forks source link

[5.4] Mailable from() method throwing ErrorException #17732

Closed silvioiannone closed 7 years ago

silvioiannone commented 7 years ago

Description:

Whenever the from() method is called in a Mailable class the following exception is thrown:

Missing argument 2 for Illuminate\Database\Eloquent\Model::setAttribute(), called in {omitted}/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 518 and defined...

Steps To Reproduce:

I just created a new mailable class with the following build() method:

/**
 * Build the message.
 *
 * @return $this
 */
public function build()
{
    return $this->from('test@test.com')
        ->markdown('emails.user.invite')
        ->with([
            'user' => $this->user,
            'from' => $this->from
        ]);
}

Removing the from() method from the chain allows the email to be sent but no sender will be set.

silvioiannone commented 7 years ago

My mistake.