engilexial
engilexial

Reputation: 153

Two arguments to closure function laravel

I have a email send function:

   Mail::send('emails.message', ['text'=> $email['message']], function($message, $email)
    {
        $message->to($email['email'], 'Name')->subject('Subj'); 
    }); 

And now i have a error: Missing argument 2 for {closure}() How i can flash $email to the my closure function?

Upvotes: 3

Views: 868

Answers (1)

Waldson Patricio
Waldson Patricio

Reputation: 1529

Try this:

function ($message) use ($email) {
   //...
}

Upvotes: 4

Related Questions