I am new to Laravel and I am trying to redirect 2 different types of users on different pages, based on their ID stored in database.
I found the authenticating redirection code in redirectifAuthenticated.php file . I don't know what wrong I am doing in code to get a successful redirection. below is my code.
public function handle($request, Closure $next)
{
if ($this->auth->check())
{
$userId = Auth::id();
if($userId == '1'){
return new RedirectResponse(url('/symptoms/view'));
}
else
{
return new RedirectResponse(url('/home'));
}
}
return $next($request);
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire