i use module in my project
App ->
Modules ->
Admin ->
Http ->
controller
middleware
request
how i use authenticate and redirect auth file in this middleware authenticate file or redirectauth file in this middleware authenticate.php
public function handle($request, Closure $next)
{
if ($this->auth->guest()) {
if ($request->ajax()) {
return response('Unauthorized.', 401);
} else {
// return redirect()->guest('auth/login');
return redirect()->guest('admin');
}
}
return $next($request);
}
redirectauthenticate.php
public function handle($request, Closure $next)
{
if ($this->auth->check()) {
// return redirect('/home');
return redirect('admin/dashbord');
}
return $next($request);
}
How i solve this ?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community