This is the documentation for
v2 but the latest version is
v5
.
You can switch versions in the menu on the left/at the top.
Check your current version with the following command:
composer show spatie/laravel-query-builder
You can install the package via composer:
composer require spatie/laravel-query-builder
The package will automatically register its service provider.
You can optionally publish the config file with:
php artisan vendor:publish --provider="Spatie\QueryBuilder\QueryBuilderServiceProvider" --tag="config"
These are the contents of the default config file that will be published:
return [
'parameters' => [
'include' => 'include',
'filter' => 'filter',
'sort' => 'sort',
'fields' => 'fields',
'append' => 'append',
],
'count_suffix' => 'Count',
];