spatie / laravel-query-builder

Easily build Eloquent queries from API requests

Home Page:https://spatie.be/docs/laravel-query-builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

when i use filters it give me a warning

abdelazim94 opened this issue · comments

Since symfony/http-foundation 5.1: Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, and will throw a "Symfony\Component\HttpFoundation\Exception\BadRequestException" exception in Symfony 6.0, use "Symfony\Component\HttpFoundation\InputBag::all($key)" instead.

Since symfony/http-foundation 5.1: Passing a non-scalar value as 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, pass a scalar or null instead.

here is my code

$result = QueryBuilder::for($query)
->allowedFilters([
'status',
AllowedFilter::custom('fields', new CaseFieldsFilter),
])
->defaultSort('-start_date')
->allowedSorts('start_date')
->paginate($this->pages);

I had the same error, the error comes from the Spatie\QueryBuilder\QueryBuilderRequest class for the getFilterValue() function because a null query is missing before the Str::contains