I am trying to add a trait for auth longin functionality in laravel. Please can anyone explain to me the meaning of : Redirection
and the reason why it works in php 7 but not 5.5? And is there anyway to make it work in PHP 5.5. Thank you
use Illuminate\Http\RedirectResponse as Redirection;
trait AuthenticatesUsers
{
public function login(Request $request, Auth $auth) : Redirection
{
$authorized = $auth->guard($this->guard)->attempt($request->only('username', 'password'));
if($authorized){
return redirect($this->redirectTo);
}
return back()->with('authError', 'Login ID or Password is incorrect.')
->withInput($request->except('password'));
}
}