Download the PHP package theamasoud/laravel-search without Composer
On this page you can find all versions of the php package theamasoud/laravel-search. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-search
Laravel Search
Installation
First, install the package through Composer.
or add this in your project's composer.json file . `
Usage
Traits
TheAMasoud\LaravelSearch\Searchable
Add the Searchable trait to your model:
Normal Search
first how to make a normel search or fillter, you should use search() method.
and you should pass a two parameters column you need to search or fillter in and the request key thet come from your request
Request key:
Normal Search Example:
- In this example I am trying to search or filter in
namecolumn in messages table and the data I will search about it's come from request keysearchlike:($request->search)
Search Multiple
By multiple search you can search in multiple columns and multiple values from request.
how to make a multiple search or fillter, you should use searchMultiple() method.
and you should pass a one array parameter column you need to search or fillter in array key and the request key thet come from your request as a value of key like:['name'=>'search_name','bio'=>'search_bio']
Request keys:
Search Multiple Example:
- In this example I am trying to search or filter in
titlecolumn in messages table and the data I will search about it's come from request keysearch_titlelike:($request->search)etc... withdescription
Search In Multiple Columns
By search in multiple you can search in multiple columns and one value from request.
how to make a search in multiple or fillter, you should use searchInMultiple() method.
and you should pass a two parameters columns you need to search or fillter in and the request key thet come from your request as a value of key
Request keys:
Search In Multiple Example:
- In this example I am trying to search or filter in
titleanddescriptioncolumn in messages table and the data I will search about it's come from request keysearchlike:($request->search)
Search In Json Column
By search in json you can search in json column and value from request.
how to make a search in multiple or fillter, you should use jsonSearch() method.
and you should pass a two parameters column you need to search or fillter in and the request key thet come from your request as a value of key
Request keys:
Search In Json Example:
My json colums has:
- In this example I am trying to search or filter in
titlecolumn in messages table and the data I will search about it's come from request keysearchlike:($request->search)