as247/wp-eloquent
Wp-Eloquent brings Laravel's Eloquent ORM to WordPress, letting you define models and query posts, users, terms, and custom tables with fluent syntax and relationships. It reduces SQL boilerplate and makes WordPress data access feel like modern PHP.
Architecture fit: as247/wp-eloquent is a fit when a WordPress plugin or theme needs Eloquent-style domain models, relationships, eager loading, casts, and query builder ergonomics over custom tables while keeping WordPress as the host application. It is not a fit for simple CPT/content queries where WP_Query and WordPress APIs are sufficient, nor for teams without Laravel/Eloquent familiarity. The package should be positioned as a data-access layer for custom-domain tables, not as a replacement for WordPress core APIs.
Integration feasibility: Feasible via Composer and a bootstrap that wires Eloquent to WordPress database credentials. A TPM should validate the “without dependencies” claim carefully: it likely means no full Laravel application dependency, not zero Composer dependencies. Confirm the actual illuminate/database version, PHP constraint, and whether the package manages its own Capsule/connection or relies on host configuration. Initial integration is moderate effort: bootstrap, model definitions, table naming, and test coverage are required.
Technical risk: The main risk is adoption and maintenance, not basic capability. At 44 stars and a last release in November 2023, the package has limited community validation. MIT licensing reduces lock-in and permits a fork, but the project may be single-maintainer. Compatibility risk includes WordPress 6.x, PHP 8.2/8.3, multisite, custom table prefixes, $wpdb behavior, and autoload/class collisions with other plugins bundling Illuminate components. The internal score of 0.91 is a positive signal, but it does not remove the need for dependency and maintainer due diligence.
Key questions: Does the package require illuminate/database, and at what version? Which PHP, WordPress, and MySQL versions are supported? How does it consume $wpdb, and does it respect WordPress table prefixes and multisite switching? Can it coexist with plugins that already load Illuminate classes? Is there an active maintainer, test suite, and release/security process? Does it support transactions, schema changes, and custom table migrations? What is the fallback plan if the package is abandoned?
Stack fit: Best fit is a WordPress plugin or theme with custom tables and complex domain logic, especially where the team already knows Laravel/Eloquent. It can sit alongside WordPress REST endpoints, admin screens, cron jobs, and WP-CLI commands. Keep WordPress responsible for authentication, hooks, options, and content APIs; use Eloquent only for custom-table persistence and query composition.
Migration path: Use a strangler pattern. Start with one greenfield custom table or a read-only sidecar model. Wrap Eloquent access behind repositories/services so WordPress code does not depend directly on model classes. Keep existing WP_Query and $wpdb paths for CPTs and legacy tables. Migrate read paths first, compare outputs against existing queries, then move write paths and transactions after confidence is established.
Compatibility: Pin both as247/wp-eloquent and its Illuminate dependency. Verify PHP and WordPress support in a staging matrix, including multisite and prefixed tables. Isolate Composer autoloading where possible to avoid collisions with other plugins. Confirm database charset/collation behavior and whether Eloquent events, timestamps, and casts behave correctly with WordPress-managed schemas.
Sequencing: 1) Run a dependency and license audit, including Composer tree and CVE exposure. 2) Spike the bootstrap and connection in non-production. 3) Model one low-risk table with tests. 4) Move a read-only path and add query logging. 5) Add write paths with transaction boundaries and rollback tests. 6) Instrument errors and performance. 7) Expand only after operational guardrails are in place.
Maintenance: Treat the package as an internal dependency requiring ownership. Pin versions, monitor Illuminate/security advisories, and budget for a fork or replacement path. MIT licensing is favorable, but low stars and infrequent releases mean the team should not assume upstream responsiveness.
Support: Expect community/GitHub support only, with no SLA. A TPM should assign an internal maintainer, document the bootstrap and model conventions, and define an exit strategy if the package stops receiving compatibility fixes.
Scaling: Eloquent is acceptable for moderate admin/API workloads but adds overhead versus tuned direct SQL. Watch for N+1 queries, memory growth in long-running workers, and missing indexes. Confirm how connections behave under WP-CLI, cron, and multisite. Eloquent does not automatically integrate with WordPress object caching, so caching must be designed explicitly.
Failure modes: Likely failures include autoload/class collisions with other Illuminate-bundling plugins, incorrect table prefix or multisite connection handling, schema drift, PHP/Illuminate version incompatibility, uncaught database exceptions, transaction misuse, and raw SQL injection if developers bypass bindings. Add health checks, slow-query logging, and integration tests around these paths.
Ramp-up: Laravel-experienced developers should ramp up in days; WordPress-only developers need guardrails and likely one to two weeks to become productive with Eloquent conventions, repositories, eager loading, and transaction handling. Provide a code-review checklist covering query binding, N+1 prevention, table naming, multisite behavior, and rollback strategy.
How can I help you explore Laravel packages today?