laravel-query-builder
laravel-query-builder copied to clipboard
Easily build Eloquent queries from API requests
I have been trying to add a simple sort to a query to sort by a date field in a related table ([see here](https://laracasts.com/discuss/channels/laravel/unable-to-add-date-sort-from-related-fields-with-collection-and-spatie-query-builder?page=1) for details), and have the following...
With the version 5.8.1 there is an issue with multiple partial filters, the query builder throw an error: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined `select count(*) as aggregate...
Hello, I am not sure if I am missing something but let me explain. When I do ```php $formFields = FormField::query()->where("id", $formField->id); $a = $formFields->firstOrFail(); \PHPStan\dumpType($a); $b = QueryBuilder::for(FormField::query()->where('id', $formField->id))...
Dear sir I had been developed out of the box a method for filtering by operator. for the example: ``` QueryBuilder::for(User::class) ->allowedFilters([ AllowedFilter::operator('salary', FilterOperator::GREATER_THAN), ]) ->get(); ``` > **_Note:_** I...
the query was completely different and complex, despite bringing the result query telescope ``` { "filter": { "cidade.id": "3549805", "nome": "santa" } } ``` ``` select "id", "nome", "cidade_id", "bairro_id"...
Hello, dear community and developers! Today i met a problem on submitting form. Each filter[any] gone to filter%5Bany%5D. It looks pretty bad as i think, so iirc it can't be...
This PR adds `AllowedRelationshipFilter` class to be used when wanting to group multiple `AllowedFilter`'s into the same exists query. ## Problem: When using multiple `AllowedFilter`'s for nested relations - the...
### Expected Behavior If none of the sort parameters in the URL are actually taken into account, because none of them is allowed, then the default sort should be used....
This new filter receives the id and allows to call the native method `whereBelongsTo` method of the model ([doc](https://laravel.com/docs/11.x/eloquent-relationships#querying-belongs-to-relationships)). The method accepts nested relationships. The filter accepts receiving an array...
Fixed bug where the include count fails if a relation has the word `Count` in it. For example, it fails for `billingCountry` by removing the word `Country` and trying to...