Generate PHP contracts from .skir schemas, expose them from Laravel, and consume them with typed PHP or TypeScript clients.
Get started with Laravel · Explore Skir
Skir is a schema language for defining data models and APIs once, then generating idiomatic, type-safe code across your stack. php-skir brings that workflow to PHP with code generators and Laravel server and client integrations.
- Define models and RPC methods in
.skirfiles. - Generate typed PHP data objects and contracts.
- Serve procedures through ordinary Laravel controllers.
- Consume them from typed PHP or TypeScript clients.
| Repository | Use it to |
|---|---|
php-skir/server |
Expose generated SkirRPC methods from Laravel controllers. |
php-skir/client |
Consume SkirRPC services through a typed Laravel client powered by Saloon. |
| Repository | Generates |
|---|---|
skir-laravel-data-generator |
Spatie Laravel Data objects, typed RPC clients, and server contracts. |
skir-php-generator |
Framework-agnostic PHP objects, typed RPC clients, and server contracts. |
skir-simple-data-objects-generator |
Immutable DTOs built on std-out/simple-data-objects, typed RPC clients, and server contracts. |
The Laravel server speaks the standard SkirRPC protocol, so clients generated by any upstream Skir generator can call it. For TypeScript, use skir-typescript-gen with the upstream skir-client runtime.