expectsJson()) { return route('login'); } } // public function handle($request, Closure $next, ...$guards) // { // // Kalau tidak ada guard dikirim dari route // if (empty($guards)) { // $guards = [null]; // } // foreach ($guards as $guard) { // if (Auth::guard($guard)->check()) { // return $next($request); // } // } // return response()->json([ // 'error' => 'Unauthorized' // ], 401); // } }