Download the PHP package pascalvgemert/laravel-simple-search without Composer
On this page you can find all versions of the php package pascalvgemert/laravel-simple-search. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pascalvgemert/laravel-simple-search
More information about pascalvgemert/laravel-simple-search
Files in pascalvgemert/laravel-simple-search
Package laravel-simple-search
Short Description Simplistic search Trait for Laravel eloquent models which can handle relevance score sorting.
License MIT
Homepage https://github.com/pascalvgemert/laravel-simple-search
Informations about the package laravel-simple-search
Laravel Simple Search
Simplistic search Trait for Laravel eloquent models which can handle relevance score sorting.
Requires Laravel 5.5 or higher!
About the package
This trait make any table searchable without the use of an Elastic Search database or Full Text Search Tables. The query consists of some simple where like methods and the possibility to sort the query on the search relevance.
Installation
You can install the package via composer:
Usage
The SimpleSearch
trait can be used only for Eloquent Models.
Search method
After this you can use the search
method on an Eloquent Model instance, like so:
You can also specify if the search result must match all the keywords or any of the keywords.
If you don't want to use the relevance score to sort, you can specify to remove the score column from the result.