dbout/wp-orm
A lightweight ORM for WordPress that brings an Eloquent-style experience to custom tables and posts. Define models, query with a fluent builder, and handle relationships without raw SQL, while staying fully compatible with the WordPress ecosystem.
$wpdb queries or high-latency REST calls. It supports the decision "keep WordPress as the editing surface, own the application layer in Laravel."WP_Query / $wpdb with injectable, mockable models improves automated test coverage on content-facing features, which affects release cadence and defect rate — a decision point when the team is choosing between "fast hack" and "maintainable seam."Consider it when:
postmeta / usermeta tables, rather than hand-written joins.Look elsewhere when:
illuminate/database and don't want to pull in the ORM as a dependency.For executives (one paragraph): WordPress is where content gets created; Laravel is where our product gets built. Today those two worlds are bridged with ad-hoc SQL or REST calls that are slow to write, hard to test, and expensive to change. This package is a small, MIT-licensed adapter that lets our Laravel code read WordPress content using the same patterns we already use everywhere else. The practical effect is that content-adjacent features — internal dashboards, search, reporting, migration tooling — ship faster and with fewer defects, and we avoid an emergency CMS replatform. Cost is effectively zero; the risk is that it is a niche project with one maintainer, which we contain by pinning the version, wrapping it behind our own interfaces, and covering it with integration tests. Recommended as a time-boxed pilot on a read-only use case, not a blanket standard.
For engineering (the honest version):
It gives you Eloquent models over wp_posts, wp_postmeta, wp_users, wp_terms and friends, so you get relationships, query builder ergonomics, and mockable data access instead of string-concatenated SQL. That's a real win for testability and for anyone who has had to maintain a 400-line $wpdb query. The caveats are non-trivial: writes to core tables bypass WordPress hooks, object cache invalidation, and capability checks, so restrict it to reads unless a specific write path has been reviewed; postmeta is EAV, so naive relationship loading will produce N+1 queries that WP_Query would have avoided — budget time for query profiling; and WordPress serializes some meta values, so you inherit the responsibility for correct (de)serialization. With 0 dependents and a single maintainer, do not adopt it as infrastructure without a plan: pin the version, keep it behind repository interfaces, and add contract tests against a real WordPress schema so a future swap is a contained change rather than a rewrite.
How can I help you explore Laravel packages today?