Introduction
Antares is a lightweight, API-focused PHP framework built around explicitness, type safety, and contract-first design.
You describe each endpoint with typed classes: a request DTO for what comes in, a response DTO for what goes out. From that one contract, Antares validates every request, serializes every response, and generates your OpenAPI spec and Swagger docs. You declare it once and it can’t drift. For the story and vision behind it, read Why Antares.
It provides everything you need to build a modern JSON API — a DI container, attribute-based routing, DTO hydration & validation, response serialization, a middleware pipeline and auto-generated OpenAPI docs — with zero magic and no hidden conventions.
Philosophy
Section titled “Philosophy”- Contract-first. Typed requests in, typed responses out. Validation, serialization and docs are all derived from the same classes.
- Explicit over implicit. Routes are defined where you can see them — attributes, array config, or YAML. No naming conventions that change behaviour silently.
- Type-safe by default. PHP 8.2+ typed DTOs, hydration that casts and checks every field, and reflection-based resolution throughout.
- Composable packages. Each concern lives in its own Composer package. Use the full framework or pull in just the container, router, or validation package.
- No configuration tax. Route caching and cache invalidation in production, and bridge auto-discovery.
- Zero bootstrap overhead. Built for worker runtimes — Swoole and FrankenPHP keep the app alive between requests.
Packages
Section titled “Packages”| Package | Composer name | Description |
|---|---|---|
core | fatjon-lleshi/antares | Application boot, Dispatcher, Pipeline, ErrorHandler, response serialization, OpenAPI, CLI, migrations |
container | fatjon-lleshi/antares-container | Reflection-based autowiring DI container |
router | fatjon-lleshi/antares-router | Attribute-based routing on top of nikic/fast-route |
validation | fatjon-lleshi/antares-validation | DTO hydration + attribute-driven validation |
bridges/monolog | fatjon-lleshi/antares-monolog-bridge | PSR-3 logger via Monolog |
bridges/eloquent | fatjon-lleshi/antares-eloquent-bridge | Eloquent ORM integration |
Requirements
Section titled “Requirements”- PHP 8.2+