- Does mmanos/laravel-search work with Laravel 10 or Laravel 11?
- No. The package targets Laravel 5.x, and its composer constraints almost certainly pin illuminate/support to 5.x with PHP 5.5/7.0-era versions, which blocks installation on Laravel 9 through 12. It also likely uses helpers removed after 5.x such as array_get and the str_* functions. Running it on a modern Laravel version requires a fork that bumps constraints, replaces deprecated helpers, and adds return types.
- How do I install mmanos/laravel-search in a Laravel application?
- Require the package with Composer, then register its service provider in your application config. Run the included migration to create the search_index table and add the Searchable trait to the Eloquent model you want to search. After that, use the provided artisan commands to build or refresh the index before querying.
- How does laravel-search score and order its results?
- Scoring is weight-based over LIKE-style matching against an index table, with each configured field contributing a weighted amount to a composite score. Results come back ordered by that score, so fields you care about more can be weighted higher. There is no inverted index, stemming, faceting, or typo tolerance, so relevance is modest compared with dedicated search engines.
- Can I weight fields for relevance with this package?
- Yes, weighting fields is the core relevance mechanism. You define which model columns are searchable and assign weights, and the package combines those into a single score used to order results. This makes it easy to, for example, rank matches on a title above matches in a description.
- Does mmanos/laravel-search support MySQL and PostgreSQL?
- Yes, the package supports both MySQL and PostgreSQL as the backing database. Because matching is done with LIKE-style queries, behavior depends on the database collation and charset, and multi-byte text handling is a common failure point in hand-rolled search like this. Test with your actual data and encoding before relying on it.
- Is mmanos/laravel-search still maintained?
- No. The last release was in June 2017, there is no maintainer activity, and the package has zero dependents, so there are no security patches or compatibility updates coming. Any defect or framework breakage becomes your responsibility. If you adopt it, plan to own a fork or migrate off it.
- Is laravel-search suitable for production or large datasets?
- It fits small, internal corpora, roughly tens of thousands of rows, such as admin or back-office search on an MVP. Query cost grows with the size of the index table because matching is LIKE-based, so it is a poor fit for high-QPS customer-facing search or relevance-critical products. For anything larger, use Laravel Scout with a managed engine or native database full-text search.
- What are the best alternatives to mmanos/laravel-search?
- On modern Laravel, the standard route is Laravel Scout with a managed engine such as Meilisearch, Typesense, or Algolia. If you want to stay inside the database, MySQL FULLTEXT indexes or PostgreSQL tsvector give you real inverted-index search without a third-party service. Either option provides stemming, ranking, and better scaling than weight-based LIKE matching.
- How do I rebuild or refresh the search index?
- The package ships artisan commands to build and refresh the search_index table, which you run after schema or data changes. Decide on an acceptable staleness window and whether indexing happens synchronously on save or is queued. For larger datasets, queued reindexing avoids blocking writes.
- Can I use laravel-search in a multi-tenant application?
- The fixed search_index table name is the main obstacle: it can collide with existing tables and complicates isolating tenants. You would need to fork the package to make the table name or connection configurable per tenant. If multi-tenancy is a hard requirement, evaluate that cost before adopting.