PHPackages                             evansims/openfga-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. evansims/openfga-php

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

evansims/openfga-php
====================

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

v1.6.0(10mo ago)616.2k↓26.6%5[5 PRs](https://github.com/evansims/openfga-php/pulls)2Apache-2.0PHPPHP ^8.3CI passing

Since May 29Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/evansims/openfga-php)[ Packagist](https://packagist.org/packages/evansims/openfga-php)[ Docs](https://github.com/evansims/openfga-php)[ RSS](/packages/evansims-openfga-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (21)Versions (21)Used By (2)

[![](.github/openfga.png)](https://openfga.dev)

OpenFGA PHP SDK
===============

[](#openfga-php-sdk)

 [![codecov](https://camo.githubusercontent.com/68470c8ffc3ff691fd68012523243fedc904f4c5919227050e9c68ac361ca97c/68747470733a2f2f636f6465636f762e696f2f67682f6576616e73696d732f6f70656e6667612d7068702f67726170682f62616467652e7376673f746f6b656e3d44595858533931543053)](https://codecov.io/gh/evansims/openfga-php) [![Psalm Type Coverage](https://camo.githubusercontent.com/2fa4d7e66143d8e48f04b3a4b82596deb37a5cc832d55db5eb5fcbd9bc6f2fca/68747470733a2f2f73686570686572642e6465762f6769746875622f6576616e73696d732f6f70656e6667612d7068702f636f7665726167652e737667)](https://shepherd.dev/github/evansims/openfga-php) [![](https://camo.githubusercontent.com/74c71e269e1f4f8015424ea2df19a807ed1becb63091d52268801815574a8c34/68747470733a2f2f7777772e626573747072616374696365732e6465762f70726f6a656374732f31303636362f6261646765)](https://www.bestpractices.dev/projects/10666)

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](https://openfga.dev/) solves this.** Define your authorization rules once, query them anywhere. This SDK provides a modern PHP interface to [OpenFGA](https://openfga.dev/) and [Auth0 FGA](https://auth0.com/fine-grained-authorization).

Installation
------------

[](#installation)

```
composer require evansims/openfga-php
```

Quickstart
----------

[](#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](https://github.com/evansims/openfga-php/wiki) to get started.

Contributing
------------

[](#contributing)

Contributions are welcome—have a look at our [contributing guidelines](.github/CONTRIBUTING.md).

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance61

Regular maintenance activity

Popularity33

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 84% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

7

Last Release

316d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3093?v=4)[Evan Sims](/maintainers/evansims)[@evansims](https://github.com/evansims)

---

Top Contributors

[![evansims](https://avatars.githubusercontent.com/u/3093?v=4)](https://github.com/evansims "evansims (372 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (50 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")[![step-security-bot](https://avatars.githubusercontent.com/u/89328645?v=4)](https://github.com/step-security-bot "step-security-bot (2 commits)")

---

Tags

abacauthorizationentitlementsfgafine-grained-access-controlfine-grained-authorizationopenfgapbacpermissionsphprbacrebacsdksecurityzanzibarsecurityAuthenticationopentelemetryauthorizationpermissionsrbacobservabilityaccess-controlabacopenfgafine-grained-authorizationrelationship-based-access-controlzanzibarauth0-fgapolicy-engine

###  Code Quality

TestsPest

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/evansims-openfga-php/health.svg)

```
[![Health](https://phpackages.com/badges/evansims-openfga-php/health.svg)](https://phpackages.com/packages/evansims-openfga-php)
```

###  Alternatives

[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)[casbin/casbin

a powerful and efficient open-source access control library for php projects.

1.3k1.4M54](/packages/casbin-casbin)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[pktharindu/nova-permissions

Laravel Nova Grouped Permissions (ACL)

136387.1k](/packages/pktharindu-nova-permissions)[casbin/think-authz

An authorization library that supports access control models like ACL, RBAC, ABAC for ThinkPHP.

27918.5k6](/packages/casbin-think-authz)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6712.1k2](/packages/hasinhayder-tyro)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
