The thing is that I have the method store into my session controller that redirects to a route, so I need that the method store stay only for guest but the route should be only for auth. here is the code.
function __construct()
{
$this->middleware('guest', ['except'=>'destroy']);
}
public function store(){
$request=request(['usuario','password']);
if(!auth()->attempt($request)){
return redirect('/');
}
if(User::getCliente($request['usuario'])==0){
return redirect('/staff');
}
return redirect('/cliente');
}
so I use middleware because only the guests can log in, but if somebody copy the url 'home/staff' or 'home/cliente' can get into this views.
Is there a way that the routes can be only for auth?