PHPackages                             apivalk/apivalk - 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. apivalk/apivalk

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

apivalk/apivalk
===============

A Lightweight, Framework-Agnostic REST API Ecosystem for PHP. Built for speed, precision, and type-safe development.

v1.5.0(3mo ago)51.8k↓32.7%4[24 issues](https://github.com/apivalk/apivalk/issues)[3 PRs](https://github.com/apivalk/apivalk/pulls)MITPHPPHP &gt;=7.2CI failing

Since Dec 20Pushed 1mo ago1 watchersCompare

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

READMEChangelog (7)Dependencies (5)Versions (9)Used By (0)

Apivalk
=======

[](#apivalk)

[![Website](https://camo.githubusercontent.com/e8cb720c8cc3059a0c42444bf29d12ec3d93e67b4fa55ff873b99fbfa7641a71/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f776562736974652d61706976616c6b2e636f6d2d626c7565)](https://apivalk.com)[![Documentation](https://camo.githubusercontent.com/d862f9daacf4f4e6bbd6a4d8fdec9b26017e127cbb831a99dee9f4b114bdb4ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d646f63732e61706976616c6b2e636f6d2d677265656e)](https://docs.apivalk.com)

### Apivalk - The OpenAPI-First Framework for REST APIs That Soar

[](#apivalk---the-openapi-first-framework-for-rest-apis-that-soar)

A Lightweight, Framework-Agnostic REST API Ecosystem for PHP. Built for speed, precision, and type-safe development.

Harness the power of the Valkyrie. APIs that soar instead of crawl. Apivalk gives you an OpenAPI-first mind that brings structure, automation, and clarity to your backend.

⚡ **OpenAPI-first** 🔒 **Scope-based Security** 🧠 **Type-safe** 🪶 **Lightweight** 🔮 **Framework-agnostic**

---

🔒 Security &amp; Authorization
------------------------------

[](#-security--authorization)

Apivalk features a robust, OpenAPI-compliant security system out of the box.

- **Identity System**: Unified handling of `UserAuthIdentity` and `GuestAuthIdentity`.
- **Scope Objects**: Granular, type-safe authorization using `Scope` objects instead of simple strings.
- **JWT &amp; OAuth**: First-class support for JWK-based JWT validation via `JwtAuthenticator` (based on `firebase/php-jwt`).
- **Middleware Pipeline**: Dedicated `AuthenticationMiddleware` and `SecurityMiddleware` for clean, decoupled authorization.

---

Why Apivalk?
------------

[](#why-apivalk)

- **OpenAPI-First**: One definition powering models, validation, routing, and documentation.
- **REST APIs, Done Right**: A clean, modern approach with structure and best practices built in.
- **Unified Standards**: Eliminating fragmentation in PHP API development.
- **Framework-Agnostic**: Use it with Laravel, Symfony, Slim, or native PHP. No lock-in.

---

Key Capabilities
----------------

[](#key-capabilities)

### 🚀 Fast Routing Engine

[](#-fast-routing-engine)

Ultra-light, minimal, and optimized routing layer inspired by PSR-7/15 conventions, with support for route caching.

### 🔒 Type-Safe Architecture

[](#-type-safe-architecture)

Strong typing for all requests and responses, strict DTOs, and predictable interfaces, even on PHP 7.2.

### 🔄 Middleware System

[](#-middleware-system)

A modern middleware pipeline for Auth, Rate Limiting, CORS, and more.

### 📝 API Documentation

[](#-api-documentation)

Automatic OpenAPI documentation generation from PHP code annotations with Swagger UI support.

---

Framework Bridges
-----------------

[](#framework-bridges)

While Apivalk is fully framework-agnostic, we offer dedicated integration bridges:

- **[Apivalk Laravel Bridge](https://github.com/apivalk/laravel-bridge)**: Automatic bootstrapping, uses Laravel's Request/Response, and drop-in `{any}` fallback route.
- **[Apivalk Symfony Bridge](https://github.com/apivalk/symfony-bridge)**: Registered as a HttpKernel controller, integrates with Symfony routing and DI container.

---

Getting Started
---------------

[](#getting-started)

### Installation

[](#installation)

```
composer require apivalk/apivalk
```

### Typical Structure

[](#typical-structure)

```
app/Http/Api/Controller/Pet/CreatePetController.php
app/Http/Api/Request/Pet/CreatePetRequest.php
app/Http/Api/Response/Pet/CreatePetResponse.php

```

### Bootstrapping

[](#bootstrapping)

```
use apivalk\apivalk\Apivalk;
use apivalk\apivalk\ApivalkConfiguration;
use apivalk\apivalk\Router\AbstractRouter;
use apivalk\apivalk\Http\Renderer\RendererInterface;
use Psr\Container\ContainerInterface;

$apivalkConfiguration = new ApivalkConfiguration(
    $router, // AbstractRouter instance
    $renderer, // Optional: RendererInterface
    $exceptionHandler, // Optional: callable
    $container // Optional: ContainerInterface
);

$apivalk = new Apivalk($apivalkConfiguration);
$response = $apivalk->run();

// $response is an AbstractApivalkResponse instance.
// If you want to output the response using the configured renderer:
$apivalk->getRenderer()->render($response);
```

---

Apivalk Ecosystem
-----------------

[](#apivalk-ecosystem)

- **[Apivalk](https://apivalk.com)**: OpenAPI-first REST API framework for PHP.
- **Apivalk CLI** (Planned): Scaffolding and generators for local DX.
- **Apivalk Cloud** (In Research): Managed platform for Apivalk APIs.

Official Website: [apivalk.com](https://apivalk.com) | Documentation: [docs.apivalk.com](https://docs.apivalk.com)

---

Contributing and local development
----------------------------------

[](#contributing-and-local-development)

- For local development, fork this repository.
- After checking out your branch, build the images:

    - `docker compose build`

    If you prefer, you can also use your own PHP setup or tools like DDEV, Lando, etc. In that case, the docker steps below are optional, and on your responsibility.
- Run commands inside the PHP 7.2 container like this:

    - `docker compose run --rm php72 `

    Examples:

    - `docker compose run --rm php72 php -v`
    - `docker compose run --rm php72 composer install`
    - `docker compose run --rm php72 composer test`
    - `docker compose run --rm php72 composer phpstan`

---

Sponsors ❤️
-----------

[](#sponsors-️)

We love our Sponsors! (Platinum, Gold, and Bronze sponsors list)

---

© 2025 Apivalk. All rights reserved. Main maintainer and founder: **Dominic Poppe**.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance66

Regular maintenance activity

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 94.5% 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

8

Last Release

104d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/786adb3e89dc65811b44746702f2b5c91e01a9e72a37f0c95f83fe06b040a6a6?d=identicon)[domipoppe](/maintainers/domipoppe)

---

Top Contributors

[![domipoppe](https://avatars.githubusercontent.com/u/2047278?v=4)](https://github.com/domipoppe "domipoppe (52 commits)")[![elyday](https://avatars.githubusercontent.com/u/6017390?v=4)](https://github.com/elyday "elyday (1 commits)")[![rjcndev](https://avatars.githubusercontent.com/u/62463725?v=4)](https://github.com/rjcndev "rjcndev (1 commits)")[![schroedingerskatze42](https://avatars.githubusercontent.com/u/4639094?v=4)](https://github.com/schroedingerskatze42 "schroedingerskatze42 (1 commits)")

---

Tags

apiapivalkdocumentationframeworklaravelopenapiphppsr-15psr-7restsymfonypsr-7phpapirestopenapipsr-15type-safe

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[api-platform/metadata

API Resource-oriented metadata attributes and factories

243.5M96](/packages/api-platform-metadata)[api-platform/state

API Platform state interfaces

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

Simple PHP Library for RESTful APIs

4818.7k4](/packages/wellrested-wellrested)

PHPackages © 2026

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