Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 663
MZH Avatar asked Nov 06 '22 05:11

MZH


1 Answers

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.

like image 110
maki10 Avatar answered Nov 15 '22 07:11

maki10