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.

v2.3.1(5d ago)54.9k↓56.4%4[18 issues](https://github.com/apivalk/apivalk/issues)MITPHPPHP &gt;=7.2CI passing

Since Dec 20Pushed 5d 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 3d ago

READMEChangelog (10)Dependencies (15)Versions (19)Used By (0)

 [![apivalk](docs/img/logo.png)](docs/img/logo.png)

apivalk 🦅
=========

[](#apivalk-)

[![Packagist Version](https://camo.githubusercontent.com/996a0af98da617c0fb4544a97b752bab71c7ec97f5dbfca1d1d63593af725f6e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61706976616c6b2f61706976616c6b)](https://packagist.org/packages/apivalk/apivalk)[![PHP](https://camo.githubusercontent.com/f741faa3bc9ecd36f76a35dced7826d4ad96fdb58b70962496f9a676ee73b561/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e322532422d626c7565)](https://www.php.net)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)[![Docs](https://camo.githubusercontent.com/9c388f69acf4f2e2ea0ed89e6a6ecc5e1202b77c78c52ed182d59e20c2055d7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d646f63732e61706976616c6b2e636f6d2d363336366631)](https://docs.apivalk.com)

**OpenAPI-first PHP framework for type-safe REST APIs.** Framework-agnostic · PSR-7/15/11/3 · PHP 7.2+

---

The Problem
-----------

[](#the-problem)

OpenAPI specs drift from code. `$_POST['name']` has no type. Nobody knows which endpoints are secured. You maintain two things — the code and the docs — and they never quite agree.

apivalk makes your PHP classes the single source of truth. Define a property once → automatic validation, type casting, OpenAPI 3.0 generation, and full IDE autocompletion.

---

Why apivalk? 🤔
--------------

[](#why-apivalk-)

- 📄 **Code is the spec** — `getDocumentation()` on your request/response classes drives validation, type casting, and OpenAPI generation from one definition. No annotation parsing, no separate YAML.
- 🔍 **Zero route registration** — drop a controller into your directory. `ClassLocator` auto-discovers it and caches the route index. No config files to update.
- ⚡ **Resource CRUD** — one `AbstractResource` declaration generates five typed CRUD endpoints with full OpenAPI coverage. ~15 hand-authored classes collapse into one resource + five thin controllers.
- 🔒 **Security built in** — JWT (JWK-based), scope enforcement, and three route security levels out of the box.
- 🧠 **Typed everything** — by the time `__invoke()` runs, input is sanitized, validated, and cast. You get `$request->body()->name`, not `$_POST['name']`.
- 💡 **Full IDE autocompletion** — `DocBlockGenerator` rewrites your request classes with typed `@method` annotations and generates `Shape/` classes per bag. `$request->body()->`, `$request->sorting()->`, `$request->filtering()->` all autocomplete with correct types in PhpStorm and VS Code — zero hand-written boilerplate.

---

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

[](#installation)

```
composer require apivalk/apivalk
```

> PHP 7.2+, `ext-json`, `ext-mbstring` — [full installation guide →](https://docs.apivalk.com/installation)

---

Quick Start
-----------

[](#quick-start)

### Bootstrap

[](#bootstrap)

```
