承接 n3xt0r/laravel-passport-authorization-core 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

n3xt0r/laravel-passport-authorization-core

Composer 安装命令:

composer require n3xt0r/laravel-passport-authorization-core

包简介

Domain-oriented authorization core for Laravel Passport, providing structured scope and permission modeling without UI or OAuth flow implementation.

README 文档

README

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.

统计信息

  • 总下载量: 2.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固