cycle/schema-renderer
Render Cycle ORM schemas as terminal-friendly output or generate PHP/array representations. Convert Schema/SchemaInterface to arrays (including optional custom properties), then render with colorized Symfony Console output; extend templates via custom console renderers.
COLLECTION_TYPE for relation blocks improves support for complex nested relations (e.g., one-to-many, many-to-many), aligning better with real-world Laravel applications.COLLECTION_TYPE constant simplifies relation block generation for common Laravel patterns (e.g., hasMany, belongsToMany).lighthouse or spatie/fractal by reducing manual workarounds for collection-type relations. For example, GraphQL List types or OpenAPI array schemas can now be auto-generated more accurately.COLLECTION_TYPE be leveraged for versioning collection relations (e.g., deprecating old List types in favor of auto-generated arrays)?items schemas)?COLLECTION_TYPE to identify underutilized or deprecated relation patterns?COLLECTION_TYPE constant simplifies relation annotations (e.g., @relation(type=COLLECTION_TYPE)), reducing boilerplate for common cases like hasMany.ModelCreated) remain unaffected but may now generate more accurate relation blocks.schema:render command can now handle collection types more efficiently.List types for collection relations, reducing manual schema definitions.array schemas for collection relations, improving documentation accuracy.COLLECTION_TYPE with models using hasMany, belongsToMany, or similar relations. Verify that generated schemas match expectations (e.g., GraphQL List<Model> or OpenAPI array).COLLECTION_TYPE.List types; manual overrides may no longer be needed for collection relations.COLLECTION_TYPE constant is namespaced within the package.composer require cycle/schema-renderer:^1.4.0).@relation(type=COLLECTION_TYPE) where applicable. Example:
#[SchemaRelation(type: COLLECTION_TYPE)]
public function comments() { ... }
SchemaRenderer facade, but now with optimized collection-type handling.COLLECTION_TYPE and deprecated manual relation definitions.COLLECTION_TYPE constant reduces manual relation annotations, lowering maintenance overhead for collection relations.List types to auto-generated arrays).COLLECTION_TYPE.COLLECTION_TYPE for common relation patterns (e.g., hasManyThrough).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Annotation syntax errors | Broken schema, API failures | Updated: Add CI checks for COLLECTION_TYPE usage. |
| Schema cache staleness | Clients use outdated schemas | Unchanged: Invalidate cache on model changes. |
| Database schema drift | Schema no longer matches DB | Unchanged: Add DB migration checks in CI. |
| Renderer package abandonment | No security/bug fixes | Unchanged: Fork or maintain a private version. |
| Performance degradation | Slow API responses | Unchanged: Profile and optimize rendering. |
| New: Manual relation overrides | Inconsistent schema generation | Updated: Deprecate warnings for manual collection-type definitions. |
How can I help you explore Laravel packages today?