Laravel-mongodb: Laravel 5.4 Fatal error

Created on 16 Jan 2017  路  3Comments  路  Source: jenssegers/laravel-mongodb

after updating to Laravel 5.4 i get this error:

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalErrorException: Access level to Jenssegers\Mongodb\Query\Builder::$operators must be public (as in class Illuminate\Database\Query\Builder) in /Users/info/_sites/ig/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php:0

Most helpful comment

It's happening because $operators in the parent class BaseBuilder was set to public 21 days ago. This happened in the commit "get rid of ridiculous mutations on query builder" by @taylorotwell https://github.com/laravel/framework/commit/bd0e8952dc73b11fe9a7d5b019161ac22f93cf78 .

Not sure why Taylor changed this but I fixed the issue by setting $operators to public in Jenssegers\Mongodb\Query\Builder. I don't want to create a pull request without knowing why @taylorotwell changed it. Can you take a look at this @jenssegers please?

All 3 comments

It's happening because $operators in the parent class BaseBuilder was set to public 21 days ago. This happened in the commit "get rid of ridiculous mutations on query builder" by @taylorotwell https://github.com/laravel/framework/commit/bd0e8952dc73b11fe9a7d5b019161ac22f93cf78 .

Not sure why Taylor changed this but I fixed the issue by setting $operators to public in Jenssegers\Mongodb\Query\Builder. I don't want to create a pull request without knowing why @taylorotwell changed it. Can you take a look at this @jenssegers please?

Thanks for the issue. I came to the same conclusion. However, I think we still have to change the access specifier despite the reason. I created a PR for this.

Just an update - I changed this manually in my application and it now works properly.

Was this page helpful?
0 / 5 - 0 ratings