From 7a96cd2e915290226de9bdbaee874c85bec32c71 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 27 Aug 2026 17:25:15 +0930 Subject: [PATCH] fix: replace removed Passport scope middleware with current classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Laravel Passport 13 renamed: - CheckScopes → CheckToken (verifies ALL listed scopes) - CheckForAnyScope → CheckTokenForAnyScope (verifies ANY listed scope) The old class names no longer exist, causing BindingResolutionException on all /api/v1/admin/* routes that use the 'scope' or 'scopes' middleware aliases. --- bootstrap/app.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 5d9932e6d..6d906fb20 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -38,8 +38,8 @@ use Illuminate\Session\Middleware\StartSession; use Illuminate\Support\Facades\Route; use Illuminate\Validation\ValidationException; use Illuminate\View\Middleware\ShareErrorsFromSession; -use Laravel\Passport\Http\Middleware\CheckForAnyScope; -use Laravel\Passport\Http\Middleware\CheckScopes; +use Laravel\Passport\Http\Middleware\CheckToken; +use Laravel\Passport\Http\Middleware\CheckTokenForAnyScope; use Laravel\Passport\Http\Middleware\CreateFreshApiToken; use League\OAuth2\Server\Exception\OAuthServerException; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; @@ -124,8 +124,8 @@ return Application::configure(basePath: dirname(__DIR__)) 'twofactor' => TwoFactorAuth::class, 'validemail' => EmailVerificationCheck::class, 'interstitial' => AccountInterstitial::class, - 'scopes' => CheckScopes::class, - 'scope' => CheckForAnyScope::class, + 'scopes' => CheckToken::class, + 'scope' => CheckTokenForAnyScope::class, 'restricted' => RestrictedAccess::class, ]); })