I keep getting this error:
"Type error: Too few arguments to function App\Http\Controllers\PageController::App\Http\Controllers\{closure}(), 1 passed and exactly 2 expected"
For this little snippet of code:
public function contact(Request $request) {
Mail::raw($request->message, function($message, $request)
{
$message->from($request->email, $request->name);
$message->to('info@test.com');
});
return view('quotation.index');
}
When changing the $request->email
to a email string the function does work. But the email needs to come from the email entered in the laravel form. Could someone help me fix this issue?
$message->from($request->email, $request->name);
? - Romantic Dev