Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Cycle Orm Adapter

Laravel Cycle Orm Adapter Laravel Package

wayofdev/laravel-cycle-orm-adapter

View on GitHub
Deep Wiki
Context7

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

Frequently asked questions about Laravel Cycle Orm Adapter
Can I use this adapter in a Laravel project that already uses Eloquent?
Yes, the adapter supports a hybrid approach. You can configure multiple database connections (e.g., `cycle` and `mysql`) and use Cycle ORM for domain entities while keeping Eloquent for legacy or simple models. This allows incremental adoption without full migration.
What Laravel versions does this package support?
The package is designed for Laravel 10.28+ only. Older LTS versions like Laravel 8.x or 9.x are not supported, so ensure your project meets this requirement before integrating.
How does Cycle ORM’s query builder differ from Eloquent’s, and will it break existing code?
Cycle ORM uses a different query DSL—no chaining methods like `whereIn()`—and relies on fluency methods like `select()->where()`. Existing Eloquent queries will need refactoring, especially for complex joins or dynamic conditions. The adapter provides a facade (`Cycle::query()`) to ease the transition.
Does this adapter support Laravel’s testing helpers like `assertDatabaseHas`?
Yes, the adapter overrides Laravel’s testing traits to work with Cycle ORM entities. You can use `assertDatabaseHas()` and similar methods, but ensure your test assertions align with Cycle’s entity structure. Custom assertions may still be needed for complex scenarios.
Can I use Laravel’s factories and seeders with Cycle ORM?
Factories and seeders are supported via companion packages like `wayofdev/laravel-cycle-factories`. These packages extend Laravel’s factory system to work with Cycle ORM entities, allowing you to seed data seamlessly during testing or migrations.
Is there a performance benefit over Eloquent for read-heavy workloads?
Yes, Cycle ORM’s compiled queries and connection pooling can outperform Eloquent in read-heavy scenarios. It’s particularly effective for polyglot persistence (e.g., SQL + Redis) or applications with complex query patterns, though benchmarking is recommended for your specific use case.
How do I handle relationships in Cycle ORM compared to Eloquent’s `hasMany` or `belongsTo`?
Cycle ORM does not use Eloquent-style relationship annotations. Instead, relationships are defined via entity annotations (e.g., `@Embedded`) or repository methods. For example, a `User` entity might use `@Embedded(collection=true)` for a one-to-many relationship, requiring manual setup in your entity classes.
What’s the migration path for existing Eloquent models and migrations?
You’ll need to refactor Eloquent models to Cycle ORM entities, replacing migrations with Cycle’s code-first schema definitions. Laravel’s `migrate` command won’t work directly; use Cycle’s `Schema` definitions or extend the adapter to support hybrid migrations. A phased approach is recommended.
Does this adapter work with Laravel’s queue system or caching?
No, there’s no direct integration with Laravel’s queue, cache, or session systems. You’ll need to manually bind Cycle ORM’s `DatabaseInterface` or create custom middleware to bridge these services, as the adapter focuses solely on ORM functionality.
Are there alternatives to this adapter for integrating Cycle ORM with Laravel?
Currently, this is the primary adapter for Cycle ORM in Laravel, maintained by WayOfDev. Alternatives include building a custom integration or using Spiral Framework’s Cycle ORM support if you’re open to non-Laravel solutions. No other Laravel-specific adapters exist for Cycle ORM as of now.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity