Weave 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

Articulate Laravel Package

denisyu-1/articulate

Articulate is a context-bounded ORM for modular PHP apps sharing database tables. Map multiple small entity classes to one table, with repositories, relations, migrations, identity map, unit of work, lazy loading, caching, and MySQL/PostgreSQL support.

View on GitHub
Deep Wiki
Context7

Articulate is a context-bounded ORM for modular PHP applications that share database tables. Instead of forcing one table to one entity class, it lets several small entity classes map to the same physical table—so LoginUser, AdminUser, and BillingCustomer can each model only the fields and behavior their module needs, preventing a single shared User class from becoming a coupling point.

  • Multiple entities per table with partial, read-only projections for public APIs.
  • Isolated identity maps and units of work per EntityManager.
  • Deliberate handling of shared-table siblings during writes and cache eviction.
  • Full ORM foundations: relations, lazy loading, migrations, type mapping, caching.
  • First-class MySQL and PostgreSQL support on PHP 8.4+.
Frequently asked questions about Articulate
Is Articulate a drop-in replacement for Laravel Eloquent?
No. Articulate is a data-mapper-style, context-bounded persistence layer built around bounded contexts, aggregate roots and per-slice optimistic locking, while Eloquent is Active Record. For a conventional Active Record Laravel application the fit is poor, but Articulate can coexist with Eloquent for one concurrency-sensitive bounded context. Treat it as an architectural choice rather than a Composer swap.
How do I install denisyu-1/articulate in a Laravel application?
Install it with Composer using the package name denisyu-1/articulate; it requires PHP 8.4 or newer and targets MySQL and PostgreSQL first-class. You then create an Articulate Connection with your PDO DSN and an EntityManager per bounded context, and wire those into a Laravel service provider. Expect to own repository bindings, transaction scoping and migration coordination yourself, because the package deliberately avoids deep Laravel coupling.
What is a context-bounded ORM and when should I use Articulate?
It means the bounded context, not the table, is the modeling boundary. Several small entity classes such as LoginUser, AdminUser and BillingCustomer can map to the same users table, each with only the fields, relations and invariants that context needs, and read-only projection entities can intentionally omit columns. Use it when a modular monolith shares tables across modules and a single shared User entity has become a coupling point.
Which PHP and Laravel versions does Articulate support?
The README requires PHP 8.4 or newer and lists MySQL and PostgreSQL as first-class database targets. Articulate is a standalone PHP ORM, so Laravel support comes from the service provider and repository wiring your team writes rather than from a pinned framework version. Check the package's composer.json on Packagist for the current constraints before committing.
Can I use Articulate alongside Eloquent in the same Laravel application?
Yes, and coexistence is the lower-risk path. Scope Articulate to one bounded context on a shared database connection and keep Eloquent for CRUD, admin panels and Nova-style tooling. You will own schema coordination between the two layers and maintain separate test harnesses, but you avoid a wholesale ORM migration.
How does optimistic locking work in Articulate 2.0 and what schema changes does it need?
Release 2.0.0 adds per-slice version guards, which require version state per bounded context, either as new columns or a side table. Sequence those Laravel migrations for rolling deploys: add them nullable or defaulted, backfill existing rows, then add constraints. Misconfigured version columns can silently disable the guards, while heavy contention can produce spurious conflict errors, so test failure injection explicitly.
How should I map Articulate write conflicts and cursor errors in Laravel?
Articulate 2.0 no longer swallows cursor-extraction failures, so its exception surface is larger than in 1.x. Register mappings in Laravel's exception handler and translate write conflicts into HTTP 409 and bad or stale cursors into 400 or 422 rather than letting them surface as 500s. Cover those mappings with feature tests, especially if cursors are exposed in public APIs.
What changed in Articulate 2.0.0 and is upgrading from 1.x safe?
2.0.0 reworks optimistic locking with per-slice version guards and changes cursor failure behavior, but the release notes list only four pull requests and no migration guide. Cursor tokens issued by 1.2.1 should be treated as suspect, particularly for UUID, JSON or composite ordering, because non-scalar order columns are normalized differently. If cursors are stored client-side or exposed publicly, treat the upgrade as a breaking contract change and assume 1.x behavior is unverified under 2.x until documented.
How do I test a Laravel app that uses Articulate instead of Eloquent?
Eloquent mocks will not help, so build integration tests against real MySQL or PostgreSQL instances. Cover the identity map and unit of work per EntityManager, shared-table sibling writes and cache eviction, optimistic-locking conflicts and cursor encoding. Add failure-injection tests for version guards and exception mapping before relying on the package in production.
Is Articulate production-ready for a Laravel modular monolith?
It can be production-ready for a single bounded context, but not as a wholesale Eloquent replacement. Positive signals include CI and a mutation-testing badge above 83 percent; risks include a major version with no visible migration guide, optimistic-locking integration, exception mapping and schema coordination. Start with one context, use rolling-deploy-safe migrations and keep your own regression tests.
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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels