laravel / telescope

An elegant debug assistant for the Laravel framework.
https://laravel.com/docs/telescope
MIT License
4.9k stars 588 forks source link

Telescope showing local.ERROR: $documents is empty {"exception":"[object] (MongoDB\Exception\InvalidArgumentException(code: 0): #672

Closed NaseebaNasi closed 4 years ago

NaseebaNasi commented 5 years ago

Telescope shows "We couldn't find anything" error while loading telescope/requests. I get this empty page instead of my api listing. I'm using mongodb. The console is showing this {"entries":[],"status":"enabled"} laravel log is showing

local.ERROR: $documents is empty {"exception":"[object] (MongoDB\Exception\InvalidArgumentException(code: 0): How can I fix it?

tomas-doudera commented 5 years ago

Hello, I have got same problem. Did you find any solution?? I can see records In DB but on telescope dashboard is nothing. {"entries":[],"status":"enabled"}

Messhias commented 5 years ago

+1, I'm facing the same issue with mongodb, unfortunately right now telescope isn't fully support MongoDB.

My solution was to remove the telescope from package.json and work without it (it's increasing a lot my logs folder).

yousifnimah commented 5 years ago

Follow the steps below:

1- Find the file vendor/laravel/telescope/src/Storage/EntryModel.php

2- Add use Jenssegers\Mongodb\Eloquent\Model as Moloquent;

3- Extend the EntryModel class by Moloquent instead of Model Like this class EntryModel extends Moloquent{

4- Comment the statement $query->where('should_display_on_index', true); at the line 170

And it will work :)

Messhias commented 5 years ago

Follow the steps below:

1- Find the file vendor/laravel/telescope/src/Storage/EntryModel.php

2- Add use Jenssegers\Mongodb\Eloquent\Model as Moloquent;

3- Extend the EntryModel class by Moloquent instead of Model Like this class EntryModel extends Moloquent{

4- Comment the statement $query->where('should_display_on_index', true); at the line 170

And it will work :)

Yes, I did that and worked fine, but anyway this isn't a permanent solution because it'll be necessary to add it to every project that we're using MongoDB.

Maybe use abstract models could be a solution?

yousifnimah commented 5 years ago

When I got time I will provide a workaround which can be executed outside the vendor directory

taylorotwell commented 4 years ago

Telescope doesn't support MongoDB.