Build PHP applications and database-backed APIs with Phalcon. PhalconKit adds REST controllers, model scaffolding, relationships, authentication, permissions, and shared HTTP, CLI, and WebSocket infrastructure to your application.
Get started · Build your first API · REST reference · All guides
- CRUD APIs with explicit rules for readable, writable, searchable, and sortable fields.
- Search screens with nested filters, pagination, counts, and related records.
- Applications with authenticated users, roles, and row-level access rules.
- Database-backed workflows with model validation, nested saves, and soft deletion.
- Background commands and optional WebSocket services sharing your application's configuration.
Your application owns its schema, business logic, controllers, and response policies. You continue to use Phalcon's models, routing, dependency injection, and events.
Install PHP 8.5+, the Phalcon extension satisfying ^5.22.0, and Composer 2, then run:
composer create-project phalcon-kit/app my-api
cd my-api
cp .env.example .env
php -S 127.0.0.1:8080 -t public public/index.phpIn another terminal:
curl --include http://127.0.0.1:8080/apiThe skeleton includes HTTP routes, a CLI entrypoint, application configuration, and model-generation scripts. Its basic routes work before you configure a database. Follow Getting Started to connect your database and choose the features your application needs.
To add the library to your own project:
composer require phalcon-kit/coreInstalling the library does not create an application bootstrap or database schema. Use the application integration guide to connect it to your project.
- Create your application's tables and migrations.
- Generate models with
./scripts/generate-models.shin the App skeleton. - Add a resource controller with explicit field and access policies.
- Call the endpoint from your frontend or another client.
For example, a configured project resource can return a page of matching rows and the total number of matches:
curl --get 'http://127.0.0.1:8080/api/project/find' \
--data-urlencode 'filters[0][field]=status' \
--data-urlencode 'filters[0][operator]==' \
--data-urlencode 'filters[0][value]=active' \
--data-urlencode 'order=id asc' \
--data-urlencode 'limit=20' \
--data-urlencode 'count=1'An illustrative response, with the resource's exposed fields:
{
"timestamp": "2026-09-29T12:00:00+00:00",
"status": "OK",
"code": 200,
"response": true,
"view": {
"data": [{"id": 1, "label": "Customer portal", "status": "active"}],
"count": 1
}
}The first resource tutorial supplies the schema, controller, access policy, and commands needed to run this example. The REST reference covers each built-in action and its results.
| I want to… | Read |
|---|---|
| Install and run an application | Getting Started |
| Add PhalconKit to a project | Application Integration |
| Build a model-backed endpoint | First REST Resource |
| Send requests and handle responses | REST Requests And Responses |
| Search, filter, sort, and paginate | REST Filtering |
| Create, update, or save batches | REST Writes |
| Load and save related records | REST Relationships |
| Build counters, facets, and exports | REST Counts And Aggregates |
| Sign in users and restrict access | Authentication and Permissions |
| Configure services and modules | Configuration |
| Create tables and generate models | Migrations and Scaffolding |
| Write commands or serve WebSockets | CLI Tasks and Web Servers And WebSockets |
| Diagnose an unexpected result | Troubleshooting |
For an existing application changing package, layout, or API contracts, use the migration guides.
Use the class reference when you need an exact method signature. The guides explain how to use those methods in an application. Optional AI-assisted development instructions cover the same conventions.
PhalconKit is independently maintained and is not affiliated with or endorsed by the official Phalcon project. See the Phalcon documentation for native framework APIs.
Report an issue · Contributing · Security · Support · Changelog
Released under the BSD 3-Clause License.