Weave Code
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 Authorization Core Laravel Package

n3xt0r/laravel-passport-authorization-core

Core components for building OAuth2 authorization flows with Laravel Passport. Provides reusable helpers and abstractions to standardize consent/approval handling and authorization logic, making it easier to implement custom Passport authorization endpoints and UI.

View on GitHub
Deep Wiki
Context7

Laravel Passport Authorization Core

Latest Version on Packagist Security Rating ISO 27001 Audit Ready GitHub Tests Action Status Maintainability Code Coverage Framework Agnostic Domain Layer OAuth2 / Passport Compatible Total Downloads


Overview

Laravel Passport Authorization Core provides a domain model and use cases for structured access control on top of Laravel Passport.

Instead of implicit authorization scattered across your codebase, it offers an explicit permission model: **resources ** (user, invoice, report) + actions (read, create, delete) stored in the database as queryable facts. You implement enforcement however you need—middleware, policies, guards, custom logic.

Single source of truth. No opinions about how you validate.


The Problem

Without This Package

  • Scopes are undocumented strings with no structure
  • Permissions defined in code, config, and middleware—scattered
  • No way to query "what can this client do?"
  • Manual governance, impossible to audit
  • Example: Dropbox integration created via CLI, permissions unclear, no visibility

With This Package

  • Permissions stored as resource:action in the database
  • Single, queryable source of truth
  • Clear what each client/user can do
  • Full audit trail, systematic governance
  • Example: Same client, explicit permissions visible in UI, queryable via code, revokable with confidence

How It Works

  1. Define Resources and Actions
  2. Query & manage Grants via Use Cases
  3. Implement enforcement in your app (middleware, policies, etc.)

Resources: Entities needing permission control (user, invoice, report, etc.)

Actions: Operations you control. Global (list, read, create, update, delete) or resource-specific (export, approve).

Grants: Permissions assigned to any OAuthenticatable entity (User, Client, ServiceAccount, or custom).

  • Polymorphic: who has the permission?
  • resource_id + action_id: which permission?
  • context_client_id (optional): in context of which client?

Use Cases: Encapsulated business logic to manage permissions (see Usecase Overview).


What This Package Does

  • Domain model for structured access control
  • Use cases for managing permissions
  • Polymorphic grant storage (User, Client, ServiceAccount, custom entities)
  • Single source of truth for permissions
  • Support for custom Passport models

What This Package Does NOT Do

  • Enforce permissions (you implement that)
  • Implement OAuth flows
  • Modify Passport internals
  • Assume your application architecture
  • Provide UI or middleware

Requirements

  • PHP ^8.4
  • Laravel ^12
  • Laravel Passport ^13

Installation

composer require n3xt0r/laravel-passport-authorization-core
php artisan vendor:publish --tag=passport-authorization-core-config

Documentation

  • Usage – Working with resources, actions, and use cases
  • Usecase Overview – Complete reference of available use cases
  • Configuration – Custom Passport models, extensibility

Audit & Compliance

  • Permissions are explicit database facts, not implicit configuration
  • Authorization context is deterministic and queryable
  • Full audit trail via activity logging
  • Supports auditability requirements commonly found in ISO 27001–aligned systems.

Relationship to Filament Passport UI

This package is the domain core for Filament Passport UI:

  • Core: domain model + use cases
  • Filament UI: admin interface for managing permissions
  • Independent evolution with stable boundary

Status

Actively developed. Feedback and contributions welcome.

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky