定制 evansims/openfga-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

evansims/openfga-php

最新稳定版本:v1.6.0

Composer 安装命令:

composer require evansims/openfga-php

包简介

Stop writing authorization logic. Start asking questions. OpenFGA high performance relationship-based access control for PHP.

README 文档

README

OpenFGA PHP SDK

codecov Psalm Type Coverage

Stop writing authorization logic. Start asking questions.

composer require evansims/openfga-php


Every app needs permissions. Most developers end up with authorization logic scattered across controllers, middleware, and business logic. Changes break things. New features require touching dozens of files.

OpenFGA solves this. Define your authorization rules once, query them anywhere. This SDK provides a modern PHP interface to OpenFGA and Auth0 FGA.


Installation

composer require evansims/openfga-php


Quickstart

use OpenFGA\Client; use function OpenFGA\{allowed, tuple}; $client = new Client(url: 'http://localhost:8080'); // Instead of scattered if statements in your controllers: if ($user->isAdmin() || $user->owns($document) || $user->team->canEdit($document)) { // ... } // Ask OpenFGA: $canEdit = allowed( client: $client, store: 'my-store', model: 'my-model', tuple: tuple('user:alice', 'editor', 'document:readme') ); // Zero business logic coupling. Pure authorization.

See the documentation to get started.


Contributing

Contributions are welcome—have a look at our contributing guidelines.

统计信息

  • 总下载量: 14.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 10
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-04