I am unable to understand why this error appears. I have created a function for user to give its credentials and log in.
Route of the function is
Route::any('login','UserController@authenticate');
public function authenticate(Request $request) {
if($request->isMethod('post')) {
$email = $request->input('email');
$password = $request->input('password');
if(Auth::attempt(array('email' => $email, 'password' => $password), true)) {
return redirect()->intended('publicPages.home_startup')->withErrors('Congratulations! You are logged in');
} else {
return redirect()->intended('publicPages.login')->withErrors('Sorry! Login Failed');
}
}
}
You will probably need this line of code in the top.
use Illuminate\Http\Request;
If you have it, you can upload the project to a repository to help better?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With