timgws / QueryBuilderParser

A simple to use query builder for the jQuery QueryBuilder plugin for use with Laravel.
MIT License
159 stars 65 forks source link

Method makeQuery in the class JoinSupportingQueryBuilderParser in v2.0.0 #65

Open markimpmc opened 1 year ago

markimpmc commented 1 year ago

The makeQuery method inherited from the QueryBuilderParser class in the JoinSupportingQueryBuilderParser class was not rewritten in v2.0.0, causing an error.

QueryBuilderParser:

protected function makeQuery(EloquentBuilder|Builder $query, stdClass $rule, $queryCondition = 'AND')

JoinSupportingQueryBuilderParser:

protected function makeQuery(Builder $query, stdClass $rule, $queryCondition = 'AND')

Error:

[2023-08-11 13:37:30]
local.ERROR: Declaration of timgws\JoinSupportingQueryBuilderParser::makeQuery(Illuminate\Database\Query\Builder $query, stdClass $rule, $queryCondition = 'AND')
must be compatible with timgws\QueryBuilderParser::makeQuery(Illuminate\Database\Eloquent\Builder|Illuminate\Database\Query\Builder $query, stdClass $rule, $queryCondition = 'AND')
timgws commented 10 months ago

Thanks for pointing this out. This is bad. I will fix this and sort out the unit tests tomorrow.

itfixit commented 7 months ago

Hi, just to add some more details, I experienced the same problem and solved it in my fork temporary. However I notice that the package minimum required version of Laravel is 8 ("illuminate/database": "^9.0||^8.0||^10.0") according to Laravel system requirements for version 8 the minimum required PHP version is 7.3 while as we know PHP union types are supported since version 8. This might do problems for Laravel 8 applications on PHP 7 and I would consider dropping support of Laravel 8 or alternatively of the union types.