A simple, extensible REST API framework for PHP

Automatic content negotiation. No magic. No bleeding into your code.

// Define a controller endpoint
class UserController extends Controller
{
    public function __construct(private IUserService $users) {}

    /** @Get("/users/:id") */
    public function getById(int $id): User
    {
        return $this->users->getById($id);
    }
}

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

// Run an integration test
$this->assertParsedBodyEquals(new User(1, 'Dave'), $this->get('/users/1'));

Install Aphiria


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