I am using spatie and standard auth.
I need to redirect the user to different pages during authorization.
I do this in the blade template. I know it's wrong, but the other options don't work.
rename middleware to verified, and apply it to all user types. 'middleware' => ['auth', 'verified']
remove the 2nd /home route & create a separate route for preuser (i.e. user-confirmation)
Your middleware should be something like this:
public function handle(Request $request, Closure $next)
{
if($request->user() === 'preuser') { // put your logic to idetify user type
return redirect()->route('user-confirmation');
}
return $next($request);
}
@lortschi Thats why he has so few 'best replies' (not)! Remember these are awarded by the person asking the question and are a mark of how well the question was answered.
In this case, the whole approach of the OP is wrong, so a lot of back and forth is just to establish the actual issue.
If the OP just walks away and does not keep up the converation then the question fails to reach a conclusion.
Tell you what, if you are looking for a solution, why not ask your own question.