denniseilander/laravel-passport-scopes-restriction
Restrict which OAuth scopes users can request with Laravel Passport. Assign allowed scopes per user or model and enforce them during token issuance, so clients can't obtain permissions they shouldn't have—keeping API access tightly scoped with minimal setup.
What the release actually is: 3.0.1 is a maintenance patch. Three of the four changelog entries are Dependabot bumps to GitHub Actions used in CI (dependabot/fetch-metadata 2.1.0→2.3.0, codecov/codecov-action 4.5.0→4.6.0). None of these affect the shipped package code. The one substantive change is Laravel 12 support (PR #58), which widens the framework version constraint rather than altering behavior.
Architecture fit: The package is a narrow, single-purpose extension to Laravel Passport — it constrains which OAuth scopes a client/request may obtain. It sits in the authorization/token-issuance path, which is exactly where you want an explicit policy layer rather than scattering scope checks across controllers. Fit is good for teams already standardized on Passport; it is irrelevant if you use Sanctum or a third-party IdP (Auth0, Keycloak, Cognito).
Integration feasibility: Low effort by design — Composer install, publish config, register middleware, declare scope mappings. No database migrations or queue workers implied. The real cost is not installation but validation: you must prove the restriction behaves correctly across every grant type you use (authorization code, password, client credentials, personal access tokens, refresh).
Technical risk:
Key questions to resolve before adoption:
php artisan config:cache) and deployable without a rebuild?Stack fit: Laravel 11/12 + Passport, PHP 8.2+. Confirm your pinned Passport major is inside the supported range — Laravel 12 support does not automatically mean Passport 13 support.
Migration path: There is nothing to migrate from if scope restriction is currently manual; the work is consolidation. If you already enforce scopes in middleware or controllers, run this package in parallel (shadow mode) first: let it evaluate and log denials without enforcing, compare against existing behavior for a full traffic cycle, then flip to enforcing. That converts an auth-path change from a leap of faith into a diff.
Compatibility checks:
composer why-not against your locked Laravel and Passport versions before merging.Sequencing:
3.0.1, tilde constraint at most) and add a changelog watch.Maintenance: Steady-state cost is low — config plus a middleware registration. The recurring cost is upstream tracking: every Passport or Laravel major requires re-validating this package, and given the patch-level Laravel 12 support, you should assume you may need to contribute the compatibility PR yourself. Budget a small recurring allowance rather than assuming zero.
Support: Community-only, no SLA, no vendor. Escalation path is "open an issue, or fork." For a security control in the auth path, name an internal owner who can read the source and patch it.
Scaling: Negligible runtime cost — an in-request scope comparison, no extra I/O if the scope map is cached. It will not be a throughput bottleneck at any realistic request volume. The scaling concern is organizational, not technical: the scope map becomes a shared artifact that every new client and endpoint must be added to, and stale maps silently accumulate.
Failure modes:
Ramp-up: Any Laravel developer can install and configure this in well under a day. The genuinely skilled part — deciding the scope policy itself and proving it holds across grant types — is 2–4 days of engineer time plus security review, and that cost is yours regardless of the package. Frame adoption as policy work with a small library attached, not as a dependency decision.
Verdict on 3.0.1: Not a feature release and not a breaking change; no re-assessment of behavior is required. Its only material effect is unblocking Laravel 12 upgrades for teams already using the package. Adoption decision should rest on the security-validation questions above, not on this changelog.
How can I help you explore Laravel packages today?