[Vuejs]-Undefined variable in laravel with vue using vform package

1👍

you are not passing the $request variable inside the closure.

public function sendEmail(Request $request){

    $beautymail = app()->make(\Snowfire\Beautymail\Beautymail::class);
    $beautymail->send('emails.welcome', [], function($message) use($request) // add use($request)
     {
        $message
            ->from('test@gmail.com')
            //->to('sampleemail@gmail.com')//this is working with static data
            ->to($request->email)
            ->subject('Welcome!');
    });
}
👤Joe

Leave a comment