A PHP trait for Laravel that adds prioritized search functionality to Eloquent models with configurable relevance scoring.
Searchable is a PHP trait for Laravel that adds search functionality to Eloquent models. It enables developers to perform prioritized searches across multiple columns and relations with configurable relevance scoring, simplifying the implementation of search features in Laravel applications.
Laravel developers who need to add search capabilities to their Eloquent models without complex setup, particularly those working on applications requiring prioritized or multi-field search results.
Developers choose Searchable for its simplicity and seamless integration with Laravel's Eloquent ORM, offering prioritized search, relation support, and flexible configuration without the overhead of external search services.
A php trait to search laravel models
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows assigning relevance weights to specific columns and relations, directly influencing search rankings as demonstrated in the configurable searchable rules with column priorities like 'users.first_name' => 10.
Works with existing Eloquent methods such as where(), with(), and paginate(), enabling easy mixing of search with other queries without breaking Laravel's fluent interface.
Supports adjusting minimum relevance thresholds and enabling full-text search prioritization, as detailed in the custom threshold and entire text search parameters.
Enables searching across related models through configurable joins in the searchable rules, allowing complex queries without manual SQL joins.
The README explicitly states it's 'not optimized for big searches,' relying on inefficient LIKE queries that can become slow with substantial datasets or high concurrency.
Requires defining searchable rules in each Eloquent model, which can be cumbersome and error-prone for applications with many models or dynamic search needs.
Targets Laravel 4.2+ and 5.0, potentially lacking compatibility with newer Laravel versions and missing updates for modern PHP or database features.