Download the PHP package dzava/global-search without Composer
On this page you can find all versions of the php package dzava/global-search. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package global-search
GlobalSearch
Installation
You can install the package via composer:
Optionally publish the config:
Usage
Add the searchableFields
method to searchable models.
Perform a search
To limit the number of results per model use the limit($limit)
method. Given a limit of 0 all matching results are returned.
If no matching records are found for a model then the group is omitted from the results. To include empty groups use the withEmpty()
method.
You can override the default group key when registering the models
If you don't want to group the results use the withoutGroups()
method.
Formatting the results
Results are formatted using the toArray
method of the model. You can use a different method by changing the toArray
option in the config file. If the method is missing from the model then it will fallback to toArray
.
You can disable formatting entirely with the withoutFormatting()
method, in which case the model is returned.
Customizing the query
You can customize the search query by implementing the searchQuery
method in your models. The method will receive two parameters, the query Builder instance and the search term, and it should return the query to be executed.
When a model uses the Laravel\Scout\Searchable
trait scout will be used automatically.
Authorization
The package will use Laravel's authorization policies, when available. If a policy is found, then the policy's authorization method is checked. You can change the authorization method used by setting the policy-method
config option.
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of global-search with dependencies
illuminate/support Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0
illuminate/database Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0