Mail functions cannot recognize request variables

Posted 3 years ago by giovanniciriello

Hi, i've this simple method of MyController :

public function send(Request $r){

    Mail::raw('content of mail', function ($m) {
        $m->to($r->email);
    });

}

The error is that: 'Undefined variable: r' That's very strange: if I log the variable $r->email, it correctly show me the variable; If I substitute $r->email with a simple string, mail perfectly works! Help me

Please sign in or create an account to participate in this conversation.