expectsJson()) { return null; } // For non-API requests, abort with 401 (so it won't try to call route('login') which may not be defined) abort(401, 'Unauthorized'); } }