wkjagt/searchable
wkjagt/searchable adds lightweight full-text search to Laravel Eloquent models. Mark fields as searchable and query across them with a simple, clean API, making it easy to build search results without pulling in a heavy external search engine.
Architecture fit
wkjagt/laravel-searchable follows the classic Laravel pattern of a trait applied to Eloquent models, with model lifecycle events driving index writes to Elasticsearch and a query scope or static method exposing search. This is architecturally idiomatic for Laravel and requires almost no ceremony to adopt on a per-model basis. It is, however, a convenience layer, not a search platform: it does not replace the need to own Elasticsearch cluster operations, index mapping design, or reindex strategy. Fit is good if we already run Elasticsearch and want to remove boilerplate; poor if this package is the reason we would introduce Elasticsearch.
Integration feasibility
Wiring is likely a composer require, a trait import on one or two models, and configuration for the Elasticsearch host. That is a days-not-weeks spike, contingent on version alignment. The real feasibility question is dependency compatibility: the package almost certainly pins an elasticsearch-php client major version and a Laravel generation (Laravel 4/5 era is the likely vintage given the star count and dependents). Elasticsearch's PHP client has had multiple breaking major releases, and Laravel's model event and config APIs have also moved. Until we verify the version matrix, effort estimates are not trustworthy.
Technical risk High, and concentrated in provenance rather than code quality:
composer update.Key questions for the maintainer/owner
elasticsearch-php major version is pinned?Position: do not adopt as a production dependency. Adopt as a reference implementation, or fork and vendor it under our ownership if the API surface genuinely saves time.
Stack fit Best fit is a Laravel application already operating Elasticsearch with a small number of searchable entities and modest write volume. Poor fit for a team with no Elasticsearch operational experience, or for a high-write service where synchronous model-event indexing would put a third-party system on the request path. Before committing, benchmark against Laravel Scout with the Elasticsearch driver — it is first-party, maintained, driver-abstracted, and already solves queued indexing and reindexing. The honest comparison is not "this package vs. nothing," it is "this package vs. Scout vs. ~300 lines of our own trait." Given zero dependents, our own trait is a credible competitor and carries no abandonment risk.
Migration path
app/ or a private package where we control the client version and error handling. If the spike reveals tight coupling to an obsolete client, reimplement — the domain logic here is not novel.Compatibility
Pin exact versions of the package, elasticsearch-php, and Laravel, and add a CI job that exercises the searchable path against the target cluster version. Treat any cluster upgrade as a combined dependency-and-package change requiring the same test gate. Do not float versions.
Sequencing Spike → fork/rewrite decision → queued indexing and error handling → mappings-as-code and reindex tooling → feature-flagged read cutover → decommission the direct model-event path. The package, if retained at all, should be confined to the earliest stage.
Maintenance Effectively self-maintained. There is no upstream to depend on for bug fixes, security patches, or Elasticsearch client bumps. Budget explicitly for fork ownership: one engineer with context, a documented patch set, and a standing line item to rebase against Laravel and Elasticsearch releases. This is the single largest hidden cost and the reason the "free MIT package" framing is misleading.
Support None beyond MIT terms. No SLA, no issue triage, no community of scale to lean on — 10 stars and 0 dependents means we are the only known operator. Internal runbooks, on-call documentation, and search-specific dashboards must be authored by us, not inherited.
Scaling Two distinct scaling concerns. Search-side: index sizing, shard planning, and mapping changes that require reindexing — standard Elasticsearch work the package neither helps nor hurts. Write-side: model-event indexing scales linearly with database writes, and if synchronous it directly inflates request latency and error rates under load. Queued, batched indexing is a prerequisite for any nontrivial write volume, and it is unlikely to be the default behavior. Assume we build it.
Failure modes
Ramp-up Low for an application developer: the trait pattern is familiar and discoverable in an afternoon. Moderate to high for operations: running Elasticsearch in production — capacity planning, snapshot/restore, mapping governance, reindex procedures, and monitoring — is a real competency investment independent of this package. The net ramp-up cost is dominated by Elasticsearch operations and fork ownership, not by learning the package itself. Plan for that in the estimate; the package's apparent simplicity understates the surrounding operational surface.
How can I help you explore Laravel packages today?