analogue/orm
Analogue is a flexible data-mapper ORM for PHP and Laravel. It separates domain models from mappers and repositories, offering fluent query building, eager-loaded relations, collections and clean persistence without the active-record constraints of Eloquent.
Architecture fit. Analogue is a Data Mapper ORM, not an Active Record ORM like Eloquent. That is the core evaluation point. It separates domain objects from persistence logic and provides a Unit of Work, Identity Map, and lazy-loaded proxies. For a bounded context with rich domain logic, aggregates, and business rules that should not inherit from Illuminate\Database\Eloquent\Model, this is a legitimate architectural fit. For the majority of Laravel applications — CRUD screens, admin panels, rapid feature delivery — it is a poor fit because it fights Laravel’s conventions and adds a second persistence paradigm.
Integration feasibility. The package is Composer-installable and MIT-licensed, with a Laravel service provider/config path and support for Laravel’s database connections. Coexistence with Eloquent at the database level is technically possible, but transaction boundaries, identity maps, and schema ownership must be designed deliberately. Framework features that assume Eloquent — authentication, Nova, Cashier, Sanctum, queue serialization patterns, policy/gate conventions — should remain on Eloquent. The integration is feasible, but it is an application-architecture project, not a package install.
Technical risk. Lifecycle risk dominates. The last release was April 2020, the project has 634 stars but zero dependents, and there is no evidence of active maintenance. PHP 8.x and Laravel 8+ compatibility must be proven with a spike, not assumed. An unmaintained ORM at the core of an application is a high-blast-radius dependency: security patches, PHP upgrades, and framework upgrades become internal work. The MIT license permits a fork, but a fork is a product-ownership commitment, not a mitigation footnote.
Key questions.
Stack fit. Adopt only where the domain complexity justifies a data mapper. Good candidates are a single bounded context with complex aggregates, invariants, and domain services. Poor candidates are whole-application replacement, CRUD-heavy products, small teams without data-mapper experience, or applications deeply coupled to Eloquent-based ecosystem packages. Keep Laravel-native concerns on Eloquent and isolate Analogue behind repositories.
Migration path. Use a strangler pattern. Introduce Analogue in one module or bounded context, map existing tables to entities, and avoid dual-writing through two ORMs. Coordinate transactions at the application-service layer. Add an anti-corruption layer so domain code does not leak ORM annotations or proxy types into controllers. If migrating existing Eloquent models, migrate read paths first, validate parity, then move writes.
Compatibility. Pin PHP and Laravel to versions verified by a proof of concept. On Laravel 9+, assume a fork or patch is required until proven otherwise. Verify Composer constraints, proxy directory permissions, cache-clearing behavior, and PHP 8.1+ deprecation output. Treat framework upgrades as requiring an ORM compatibility gate.
Sequencing.
Maintenance. Expect to self-maintain. Budget for a named owner, a fork or patch process, and compatibility work on every PHP/Laravel upgrade. Dependency updates are not “set and forget”; they are an engineering line item.
Support. Community support is effectively inactive, documentation is frozen, and hiring developers with Analogue experience is unrealistic. Internal documentation, patterns, and onboarding material become mandatory. A TPM should treat support as an internal platform capability.
Scaling. The data-mapper pattern is not inherently slow, but the Unit of Work and Identity Map can retain large object graphs in long-running workers such as Octane or queue consumers. Lazy loading creates N+1 risk. Performance validation should include memory growth, query counts, and transaction duration under realistic load.
Failure modes. Likely failure modes include proxy-generation failures on deploy, stale proxy caches, identity-map memory growth in long-running processes, incorrect transaction demarcation, schema drift where migrations and mappings diverge, and fatal incompatibilities on PHP upgrades. Mixing Eloquent and Analogue on the same tables raises duplicate-persistence and cache-coherence risks.
Ramp-up. Eloquent-native developers should expect weeks, not days, to become productive with entities, mappers, proxies, Unit of Work, and aggregate boundaries. Ramp-up is manageable for senior engineers with Doctrine or data-mapper experience and expensive for teams without it. The TPM recommendation is therefore conditional: do not adopt for a new core platform without an owned fork and a bounded-context isolation plan; evaluate Doctrine ORM first if the data-mapper requirement is genuine.
How can I help you explore Laravel packages today?