0

Authenticate.php

public function handle($request, Closure $next, $guard = null)
{
    if(Auth::guard($guard)->guest()){
        if($request->ajax() || $request->wantsJson()){
            return response('Unauthorized', 401);
        }else{
            return redirect()->guest('login');
        }
    }

    return $next($request);
}
  • The package path adds vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php

Kernel.php

protected $routeMiddleware = [
    'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
];
  • Package path added in app/Http/Kernel.php file

enter image description here

  • Console error after entering php artisan make:auth command
  • Isn't it duplicate? https://stackoverflow.com/questions/34545641/php-artisan-makeauth-command-is-not-defined – fatm May 28 '23 at 05:35

0 Answers0