|
|
@ -9,6 +9,12 @@ Element Search is available on composer. To install, simply run:
|
|
|
|
composer require element/search
|
|
|
|
composer require element/search
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Then, add the following line to the `$providers` array in the `config/app.php` file:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
``` php
|
|
|
|
|
|
|
|
Element\Search\SearchServiceProvider::class,
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Use
|
|
|
|
## Use
|
|
|
|
|
|
|
|
|
|
|
|
Making your models searchable is easy. The models simply need to implement the ```php Element\Search\SearchableContract ```
|
|
|
|
Making your models searchable is easy. The models simply need to implement the ```php Element\Search\SearchableContract ```
|
|
|
@ -65,5 +71,5 @@ any string you wish to search for. Additionally, you don't have to worry about r
|
|
|
|
or capital letters from your search string, the function does it automatically.
|
|
|
|
or capital letters from your search string, the function does it automatically.
|
|
|
|
|
|
|
|
|
|
|
|
The search function, whether in the model, or called from the facade, returns the models in the form
|
|
|
|
The search function, whether in the model, or called from the facade, returns the models in the form
|
|
|
|
of a \Laravel\Database\Eloquent\Collection collection. This allows you to perform all the usual
|
|
|
|
of a \Laravel\Database\Eloquent\Collection` collection. This allows you to perform all the usual
|
|
|
|
functions you would be able to perform on a database query.
|
|
|
|
functions you would be able to perform on a database query.
|
|
|
|