Skip to content
Advertisement

Laravel Lumen 5.7, debugbar throw Call to a member function listen on null

I’m trying to use the debugbar with lumen and jenssegers/laravel-mongodb , it wasn’t showing the database queries so I enabled.

DB::connection('mongodb')->enableQueryLog();

But now it shows this error.

`Call to a member function listen() on null

in LaravelDebugbar.php line 354`

Another thing is that it only displays the debugbar on the home URL /, other than home URL it doesn’t display the debugbar.

image

Without DB::connection(‘mongodb’)->enableQueryLog(); or DB::enableQueryLog(); it renders, but doesn’t show the database queries information, and it works with home page only.

image

Thank you

Advertisement

Answer

Where are you put DB::connection('mongodb')->enableQueryLog();?

According to this issue on a master debugbar you need to call it on AppServiceProvider.php‘s boot() function. Did you try that?

If this above not working, rather search help on debugbar issues, because I think that problem is with the plugin, not your code. And there is a many Mongo issues, definitely look there first.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement