Based on: https://laravel.com/docs/5.8/telescope
First, we should run “composer require” for development environment only with version 2.x to be compatible with Laravel 5.8:
composer require laravel/telescope 2.x --dev
If we would like to run it in production then we should omit the –dev option.
It’s important to check if “laravel/telescope” is in the “dont-discover” array in composer.json. In case it is we should remove since we want Composer to discover “laravel/telescope”.
In order to install, publish and migrate telescope we should run the following commands:
php artisan telescope:install
php artisan telescope:publish
php artisan migrate
In our local environment we can now check telescope dashboard in /dashboard url. In case we navigate through our web application and we are not getting any requests registered in Telescope it’s important to check the console to try to discover what is causing this problem.
If you are using Laravel in a staging or production environment you have to change APP_ENV in .env file. For example, APP_ENV=staging. Then you should add your e-mail or another rule that allows your user to access the Telescope dashboard in the gate method of the file “app/Providers/TelescopeServiceProvider.php”. For example:
protected function gate()
{
Gate::define('viewTelescope', function ($user) {
return in_array($user->email, [
'myemail@somedomain.com',
]);
});
}
If you are using MongoDB with Laravel a lot of things are not going to work properly, including Telescope. We used https://github.com/jenssegers/laravel-mongo and we ran into a lot of issues. If you really need to use it you will need to override EntryModel.php to make it work and you will need to tweak it even more or accept that some features will simply not work.