psx/schema
PSX Schema describes database schemas in a JSON or YAML definition, then generates Doctrine DBAL schema, PHP model classes, and other formats. It can import existing schemas from MySQL or Doctrine, keeping database structure portable, version-controllable, and easy to evolve in PHP applications.
Architecture fit. psx/schema is a framework-agnostic parser/generator for schema dialects (TypeSchema, JSON Schema, OpenAPI, RAML, XSD, JSON-LD) that normalizes everything through an internal TypeSchema model. It has no illuminate/* coupling, so it composes cleanly as a domain service behind an interface inside a Laravel app. That is the right shape — but it means the package gives you schema objects, not Laravel artifacts. Any DTOs, FormRequests, validation rules, or API Resources remain our code (or generated code we own).
Integration feasibility. Low friction on paper: composer require psx/schema, PSR-4 autoload, no service provider needed. The real effort is mapping the TypeSchema object model onto our conventions — a nontrivial adapter layer if we want generated code that looks like the rest of the codebase rather than PSX-flavored DTOs.
Technical risk.
additionalProperties, nullability, oneOf/anyOf, discriminator handling, OpenAPI 3.0 vs 3.1). Silent mis-generation is the dangerous failure mode — it produces code that compiles and fails at the boundary.Key questions to resolve before committing.
Stack fit. Position it as a developer-experience and contract-governance tool, not a runtime dependency. Two viable placements:
Migration path. Do not retrofit existing contracts. Sequence:
app/Generated/ → diff against hand-written equivalents. This answers the fidelity questions empirically.SchemaRegistry/ContractCompiler interface in our domain layer so the underlying library is swappable.Compatibility. Verify Composer constraints against our PHP/Laravel matrix and confirm zero transitive Laravel/Eloquent collisions. Pin a version, and vendor-fork if we need a patch we can't upstream.
Sequencing.
Maintenance. Single-maintainer dependency is the dominant operational risk. Mitigate with: pinned version, a documented fork path, an adapter boundary, and a quarterly dependency-health review with explicit exit criteria (e.g., no release in 12 months → evaluate alternatives).
Support. Community-only. No vendor SLA. We need one named internal SME who can debug a parse failure — this is not a "nobody owns it" dependency.
Scaling. Build-time usage scales fine — it's a CI cost linear in schema size. Runtime usage is the concern: parsing per request will show up in p95 latency and memory, and there is no obvious caching story inside the library. If we ever need runtime parsing, add an opaque cache keyed on schema hash.
Failure modes to instrument.
Ramp-up. Small, well-scoped API surface — a senior PHP developer reaches productivity in roughly 1–2 days. The real learning curve is the TypeSchema intermediate model and its semantics, not the PHP. Budget half a sprint for the first engineer plus a written internal guide covering the adapter and the generation workflow, so the knowledge doesn't stay with one person.
How can I help you explore Laravel packages today?