tpetry / laravel-postgresql-enhanced

Support for many missing PostgreSQL specific features
MIT License
777 stars 31 forks source link

Declaration of BuilderWhere::orWhereAll must be compatible with Illuminate\Database\Query\Builder::orWhereAll #76

Closed CodeLieutenant closed 8 months ago

CodeLieutenant commented 8 months ago

This error manifested itself on artisan vendor:publish --tag=laravel-assets, I don't know really why there, but it looks like some package does something with the database at publishing.

I've checked there are many methods like this, that are not compatible with Laravel's Eloquent Builder. The problem is (I think) trait overriding methods when extending the base Eloquent Builder.

It's nice to have types in the codebase, but unfortunately, we should wait for Laravel to add those types to the Builder.

Declaration of Tpetry\PostgresqlEnhanced\Query\BuilderWhere::orWhereAll($column, string $operator, Traversable|array $values): static must be compatible with Illuminate\Database\Query\Builder::orWhereAll($columns, $operator = null, $value = null)

Laravel version: 10.47 PHP version: 8.3 laravel-postgresql-enhanced version: 0.35

PS. If you are ok with it, I would like to make these changes to the library. Also thank you for this AWESOME piece of software, really makes life a lot easier using Postgres Database.

tpetry commented 8 months ago

Laravel added their own whereAll method yesterday. I‘ll have to look tomorrow how to fix it. Will probably be a breaking change. I‘ve expected this problem to happen for so long. Its interesting that it is only happening after almost three years.

CodeLieutenant commented 8 months ago

Thanks for a such quick reply.

For everyone who encounters the same problem, just lock Laravel in composer.json to v10.46 until the issue is resolved by @tpetry.

tpetry commented 8 months ago

I had to rename some methods to not conflict with Laravel 10.47 anymore. If you upgrade to 0.36.0 everything will work correctly again 😉

Renamed query builder methods: