PHPackages                             aphiria/aphiria - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. aphiria/aphiria

ActiveLibrary[HTTP &amp; Networking](/categories/http)

aphiria/aphiria
===============

The Aphiria framework

1.x-dev(3mo ago)1427.7k—0%5[7 issues](https://github.com/aphiria/aphiria/issues)[2 PRs](https://github.com/aphiria/aphiria/pulls)2MITPHPPHP ^8.4CI passing

Since Oct 24Pushed 3mo ago6 watchersCompare

[ Source](https://github.com/aphiria/aphiria)[ Packagist](https://packagist.org/packages/aphiria/aphiria)[ Docs](https://www.aphiria.com)[ GitHub Sponsors](https://github.com/sponsors/davidbyoung)[ RSS](/packages/aphiria-aphiria/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (17)Used By (2)

[![](https://camo.githubusercontent.com/b524a39ab8922b927ed94708692e2de878abfe1f9d859dbbb4d82eab6ab59156/68747470733a2f2f7777772e617068697269612e636f6d2f696d616765732f617068697269612d6c6f676f2e737667)](https://www.aphiria.com "Aphiria")

[![](https://github.com/aphiria/aphiria/workflows/ci/badge.svg)](https://github.com/aphiria/aphiria/actions)[![Coverage Status](https://camo.githubusercontent.com/8c9fb79eb1621fcf12ebe8fab779a6f1047e1e064690d2c64b5e77d92e3dc500/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f617068697269612f617068697269612f62616467652e7376673f6272616e63683d312e78)](https://coveralls.io/github/aphiria/aphiria?branch=1.x)[![](https://camo.githubusercontent.com/c5492d85b85c9733d743f48e704e77552a254ec383f0c9ac123daad20e989513/68747470733a2f2f73686570686572642e6465762f6769746875622f617068697269612f617068697269612f6c6576656c2e737667)](https://psalm.dev)[![](https://camo.githubusercontent.com/d375d088c8159890d87f21042fca02f61a534f61cf8f996629c7c79178d0ea04/68747470733a2f2f706f7365722e707567782e6f72672f617068697269612f617068697269612f762f737461626c652e737667)](https://packagist.org/packages/aphiria/aphiria)[![](https://camo.githubusercontent.com/282e536f87788f17c055451e988e0f141ec4e5fce140ff8f330d879029ddf738/68747470733a2f2f706f7365722e707567782e6f72672f617068697269612f617068697269612f762f756e737461626c652e737667)](https://packagist.org/packages/aphiria/aphiria)[![](https://camo.githubusercontent.com/5d260a5351f63aa5cd1d6ca08244fe51497767e2251d7154d9928ee7a839ea58/68747470733a2f2f706f7365722e707567782e6f72672f617068697269612f617068697269612f6c6963656e73652e737667)](https://packagist.org/packages/aphiria/aphiria)

> **Note:** This framework is not stable yet.

Introduction
------------

[](#introduction)

Aphiria is a suite of small, decoupled PHP libraries that make up a REST API framework. It simplifies content negotiation without bleeding into your code, allowing you to write expressive code. Aphiria also provides the following functionality out of the box:

- [Automatic content negotiation](https://www.aphiria.com/docs/1.x/content-negotiation) of your POPOs
- [One of the fastest, most feature-full routers in PHP](https://www.aphiria.com/docs/1.x/routing)
- [A modular way of building your apps from reusable components](https://www.aphiria.com/docs/1.x/application-builders#basics)
- [An extensible authentication scheme](https://www.aphiria.com/docs/1.x/authentication)
- [A policy-based authorization control system](https://www.aphiria.com/docs/1.x/authorization)
- [A DI container with binders to simplify configuring your app](https://www.aphiria.com/docs/1.x/dependency-injection)
- [A model validator for your POPOs](https://www.aphiria.com/docs/1.x/validation)
- Support for [route](https://www.aphiria.com/docs/1.x/routing.html#route-attributes) and [validation](https://www.aphiria.com/docs/1.x/validation) attributes

```
// Define some controller endpoints
class UserController extends Controller
{
    public function __construct(private IUserService $users) {}

    #[Post('/users')]
    public function createUser(User $user): IResponse
    {
        $this->users->create($user);

        return $this->created("/users/$user->id", $user);
    }

    #[Get('/users/:id')]
    #[AuthorizeRoles('admin')]
    public function getUserById(int $id): User
    {
        return $this->users->getById($id);
    }
}

// Bind your dependency
$container->bindInstance(IUserService::class, new UserService());

// Run an integration test
$postResponse = $this->post('/users', new User('Dave'));
$user = $this->readResponseBodyAs(User::class, $postResponse);
$admin = new PrincipalBuilder('example.com')
    ->withRoles('admin')
    ->build();
$getResponse = $this->actingAs($admin, fn() => $this->get("/users/$user->id"));
$this->assertParsedBodyEquals($user, $getResponse);
```

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

[](#installation)

Create an Aphiria app via Composer:

```
composer create-project aphiria/app --prefer-dist --stability dev
```

Refer to the [documentation](https://www.aphiria.com/docs/1.x/installation) for more details.

Documentation
-------------

[](#documentation)

Full documentation is available at [the Aphiria website](https://www.aphiria.com).

Requirements
------------

[](#requirements)

- PHP &gt;= 8.4

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

[](#contributing)

We appreciate any and all contributions to Aphiria. Please read the [documentation](https://www.aphiria.com/docs/1.x/contributing) to learn how to contribute.

Community
---------

[](#community)

If you have general questions or comments about Aphiria, join our [GitHub Discussions](https://github.com/aphiria/aphiria/discussions).

Directory Structure
-------------------

[](#directory-structure)

Aphiria is organized as a monorepo. Each library is contained in *src/{library}*, and contains *src* and *tests* directories.

License
-------

[](#license)

This software is licensed under the MIT license. Please read the [LICENSE](LICENSE.md) for more information.

Author
------

[](#author)

Aphiria was created and primarily written by [David Young](https://github.com/davidbyoung).

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance78

Regular maintenance activity

Popularity39

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% 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 ~169 days

Recently: every ~286 days

Total

12

Last Release

108d ago

PHP version history (4 changes)v1.0.0-alpha1PHP ^8.0

v1.0.0-alpha5PHP ^8.1

v1.0.0-alpha8PHP ^8.2

v1.0.0-alpha10PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb2c80fe0017b82289c6c9bba6b6bcdd6ececb20da98c03202c34236b498c514?d=identicon)[opulence](/maintainers/opulence)

---

Top Contributors

[![davidbyoung](https://avatars.githubusercontent.com/u/6652430?v=4)](https://github.com/davidbyoung "davidbyoung (1381 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (14 commits)")[![alchimik](https://avatars.githubusercontent.com/u/1812902?v=4)](https://github.com/alchimik "alchimik (10 commits)")[![13dev](https://avatars.githubusercontent.com/u/17799292?v=4)](https://github.com/13dev "13dev (1 commits)")[![dac514](https://avatars.githubusercontent.com/u/812192?v=4)](https://github.com/dac514 "dac514 (1 commits)")[![nikic](https://avatars.githubusercontent.com/u/216080?v=4)](https://github.com/nikic "nikic (1 commits)")

---

Tags

apiauthenticationauthorizationconfigurationcontent-negotiationdependency-injectionframeworkphprest-apiroutervalidationhttpphpapirestrouterAuthenticationauthorizationcontent negotiationpbac

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aphiria-aphiria/health.svg)

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k48.1M236](/packages/api-platform-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[api-platform/symfony

Symfony API Platform integration

323.2M67](/packages/api-platform-symfony)[api-platform/state

API Platform state interfaces

223.4M57](/packages/api-platform-state)

PHPackages © 2026

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