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, Laravel server and client integrations, and a TypeScript runtime for generated clients and services.
- 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. |
@php-skir/skir-client is the runtime used by generated TypeScript clients and services. It supports Skir's default transport as well as opt-in CBOR request and response bodies.
Note
CBOR is a php-skir ecosystem extension and is not part of upstream Skir's standard RPC transport. Enable it on both sides of a connection; otherwise, keep the default transport for upstream compatibility.