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="query-builder-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',
],
'delimiter' => ',',
'filter_value_splitting_enabled' => true,
'suffixes' => [
'count' => 'Count',
'exists' => 'Exists',
'min' => 'Min',
'max' => 'Max',
'sum' => 'Sum',
'avg' => 'Avg',
],
'disable_invalid_filter_query_exception' => false,
'disable_invalid_sort_query_exception' => false,
'disable_invalid_include_query_exception' => false,
'convert_relation_names_to_snake_case_plural' => true,
'convert_relation_table_name_strategy' => null,
'convert_field_names_to_snake_case' => false,
];