aloko/elasticquent5
Elasticquent5 brings Elasticsearch to your Laravel Eloquent models with a simple trait, letting you index, search, and query documents without leaving the familiar Eloquent API.
Architecture fit
ElasticquentTrait) added to existing Eloquent models that serializes model state into Elasticsearch documents and exposes addToIndex, removeFromIndex, search, searchByQuery, and aggregate helpers over the official elasticsearch/elasticsearch PHP client.Integration feasibility
composer require, publish config/elasticquent.php, add the trait, define getIndexName() / getTypeName() / getMapping(). A TPM can scope a spike to 2–3 days for one model and a proof-of-concept search endpoint.Technical risk
Key questions
Stack fit
elasticsearch/elasticsearch client behind a small repository class is more work up front and materially cheaper to own.Migration path
SearchRepository / interface, never call trait methods from controllers. Swapping to Scout or a raw client then becomes one file, not a codebase sweep.Compatibility
aloko/elasticquent5 and elasticsearch/elasticsearch to exact versions with composer.lock committed. Floating constraints on an unmaintained package are an incident waiting for a transitive release.providers / aliases registration in config/app.php is the likely path. Budget for it.Sequencing
Maintenance
Support
Scaling
Failure modes
Ramp-up
search() as a safe ORM call when it is a network call with distinct failure semantics. Enforce the repository boundary in code review.Recommendation: viable only as a short-lived bridge inside an already-EOL Laravel 5 system where search is non-critical. For any surface with revenue attached, or any system with a framework upgrade ahead of it, the maintenance and EOL-coupling costs exceed the integration savings — Scout with a maintained driver, or a thin in-house client wrapper, is the defensible default.
How can I help you explore Laravel packages today?