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
Apivalk features a robust, OpenAPI-compliant security system out of the box.
- Identity System: Unified handling of
UserAuthIdentityandGuestAuthIdentity. - Scope Objects: Granular, type-safe authorization using
Scopeobjects instead of simple strings. - JWT & OAuth: First-class support for JWK-based JWT validation via
JwtAuthenticator(based onfirebase/php-jwt). - Middleware Pipeline: Dedicated
AuthenticationMiddlewareandSecurityMiddlewarefor clean, decoupled authorization.
- 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.
Ultra-light, minimal, and optimized routing layer inspired by PSR-7/15 conventions, with support for route caching.
Strong typing for all requests and responses, strict DTOs, and predictable interfaces, even on PHP 7.2.
A modern middleware pipeline for Auth, Rate Limiting, CORS, and more.
Automatic OpenAPI documentation generation from PHP code annotations with Swagger UI support.
While Apivalk is fully framework-agnostic, we offer dedicated integration bridges:
- Apivalk Laravel Bridge: Automatic bootstrapping, uses Laravel's
Request/Response, and drop-in
{any}fallback route. - Apivalk Symfony Bridge: Registered as a HttpKernel controller, integrates with Symfony routing and DI container.
composer require apivalk/apivalkapp/Http/Api/Controller/Pet/CreatePetController.php
app/Http/Api/Request/Pet/CreatePetRequest.php
app/Http/Api/Response/Pet/CreatePetResponse.php
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: 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 | Documentation: docs.apivalk.com
We love our Sponsors! (Platinum, Gold, and Bronze sponsors list)
© 2025 Apivalk. All rights reserved. Main maintainer and founder: Dominic Poppe.