cycle/annotated
Define Cycle ORM entities and schema using PHP 8 attributes. Annotate columns, primary keys, enums, decimals, and relationships like HasOne, HasMany, and BelongsTo, then let Cycle build the mapping from your code.
DatabaseServiceProvider.whereRaw, join) would need to adapt.create(), factory()).ManyToMany or MorphedHasMany require careful setup. Debugging misconfigured relations (e.g., circular dependencies) could be challenging.timestamps, softDeletes, observer events). Would need custom annotations or workarounds.Illuminate\Database\Eloquent\Model with annotated entities.doctrine/dbal).ModelFactory).User, Order) to annotated entities.Model::boot() observers).hasManyThrough).| Feature | Compatibility | Workaround |
|---|---|---|
| Eloquent Models | ❌ Incompatible | Replace with annotated entities or use a facade layer. |
| Laravel Migrations | ✅ Compatible (but redundant if using annotations) | Use Cycle ORM’s schema generation or keep migrations for non-annotated tables. |
| Query Builder | ❌ Incompatible | Use Cycle ORM’s query builder or abstract via repositories. |
| Eloquent Relations | ❌ Incompatible | Replace with HasOne, BelongsTo, etc. |
| Soft Deletes | ❌ Not natively supported | Implement via Column(type: 'boolean') + custom scope. |
| Observers/Events | ❌ Incompatible | Use Cycle ORM’s lifecycle callbacks or event system. |
| API Resources | ✅ Compatible (if using spatie/laravel-api-resources) |
No changes needed. |
| Scout (Search) | ❓ Unknown | May require custom integration or switch to Algolia/Meilisearch directly. |
| Breeze/Jetstream Auth | ❌ Likely incompatible | Replace with custom auth logic or adapt packages. |
User, Product) to validate the annotation syntax.HasOne/BelongsTo before complex relations like ManyToMany or polymorphic types.use Illuminate\Database\Eloquent\Model).How can I help you explore Laravel packages today?