Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Passport Scopes Restriction Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API authorization hardening roadmap: laravel-passport-scopes-restriction lets a Laravel app constrain which OAuth scopes a client or user may actually be granted, closing a common gap where any registered client can request any defined scope. That makes it directly relevant to decisions about tightening third-party and partner API access without rebuilding the authorization layer.
  • Build vs. buy (build vs. adopt): scope-restriction logic is small but security-sensitive and easy to get subtly wrong (token refresh paths, personal access tokens, password grants). Adopting a maintained package beats an in-house middleware for most teams unless the authorization model is highly bespoke.
  • Laravel 12 upgrade planning: release 3.0.1 adds Laravel 12 support, so this package no longer blocks a framework upgrade on Laravel 11 → 12 migrations. That removes a known upgrade objection from the roadmap.
  • Feature gating by plan/tier: a natural fit for SaaS products where scopes map to customer entitlement tiers — the restriction layer becomes the enforcement point for "which API capabilities does this account get."
  • Use cases: multi-tenant APIs, partner integrations, OAuth-based public APIs, and any product where scopes are a customer-facing contract rather than internal plumbing.

When to Consider This Package

Consider adoption when:

  • The product exposes a Laravel Passport-powered OAuth API to more than one client type, especially external or partner clients.
  • Scope definitions exist but are not currently validated against per-client or per-user allowed scope sets.
  • The team is planning or executing a Laravel 12 upgrade and wants dependency risk retired.
  • Security/compliance requirements (least-privilege access, auditability of granted permissions) are being formalized.
  • Scope-to-entitlement mapping is a product concern (plans, tiers, feature flags), not just a backend detail.

Look elsewhere when:

  • The API is first-party only, with a single trusted client — the restriction layer adds configuration for little gain.
  • Authorization requirements are custom enough that a thin in-house policy layer is simpler than adapting a package's opinionated model.
  • The team is on a non-Passport auth stack (Sanctum-only, external IdP, or a gateway handling scopes), where this does not apply.
  • Long-term maintenance appetite is low and dependency surface area is a hard constraint — note the project is a small, single-maintainer package, so pinning and reviewing upgrades is prudent even where it fits well.

How to Pitch It (Stakeholders)

To executives: Our API can currently grant any defined scope to any registered client. This package adds a restriction layer so clients and users can only receive the scopes they're entitled to — a direct least-privilege control and a checkable item in security reviews. The latest release (3.0.1) adds Laravel 12 support, so it also clears a dependency from our framework upgrade path. Cost is low: one dependency and configuration, no rework of the auth system.

To engineering: Small, focused package that hooks into Passport's scope granting to enforce per-client/per-user allowlists. v3.0.1 is largely maintenance (Dependabot bumps) plus the material change: Laravel 12 compatibility — no breaking changes signaled from 3.0.0. Recommended next step is a short spike: confirm our grant types and personal access token flows are covered, pin the version, and add tests asserting that disallowed scopes are rejected at token issuance and refresh. If our model diverges from the package's assumptions, the fallback is a thin custom policy layer of comparable scope.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support