Level 102
if(! Sentinel::authenticate($request->all()) {
throw new Exception; //or return a response with an error code
}
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
This is my code;
public function postLogin(Request $request){
$validator = Validator::make($request->all(), $this->loginDataRules(), $this->loginMessages());
if ($validator->fails()) {
$request->flash();
return redirect()->back()->withErrors($validator);
}else{
$signinfo = $this->signinfo();
if ($signinfo == true)
{
return view('profile');
}
else
{
Sentinel::authenticate($request->all()); // *** I want to expand this code. ***
return redirect('/account');
}
}
}
Expansion for Sentinel. I want to return an error message if the email or password is entered incorrectly.
According to the docs it returns either the Cartalyst\Sentinel\Users\UserInterface or false.
My guess is that false is for when it fails. So if it fails you throw an error
Please or to participate in this conversation.