Introduction:
First you should know, when you run php artisan install:telescope
App\Providers\TelescopeServiceProvider::class
is added to config/app.php
and TelescopeServiceProvider
inside the app/providers/
directory and to uninstall temporary the Laravel Telescope you should comment out that line in the config/app.php.
Also there is a telescope.php
in config
folder which you can put false
to disable it if you don’t want completely remove its serviceprovider.
'enabled' => env('TELESCOPE_ENABLED', false),
Issue:
Now lets deal with the error that you want to know the solution:
As you see I had a problem in installation Laravel Telescope in Laravel Framework 6.4.1
Before you continue with the rest of this tutorial, I would like to introduce two packages for Laravel that I have recently developed: Laravel Pay Pocket, a modern multi-wallet package, and Laravel Failed Jobs, a UI for the Laravel Failed Jobs Table. I hope they may be of help to you.
https://github.com/HPWebdeveloper/laravel-pay-pocket
https://github.com/HPWebdeveloper/laravel-failed-jobs
So I did:
php artisan cache:clear
and
php artisan config:clear
I started again from “composer require …” and I understood I couldn’t run again:
composer require laravel/telescope
Just because of another new error:
In ProviderRepository.php line 208:
Class ‘App\Providers\TelescopeServiceProvider’ not found
I found the only change after the last installation command (I mean this):
php artisan telescope:install
was this new line in config/app.php file:
App\Providers\TelescopeServiceProvider::class,
That causes the error and it seems the installation was not complete and only that line was added!
So I commented that line in config/app.php file and
php artisan cache:clearphp artisan config:clear
again ran :
php artisan telescope:install
It was successful!
I also was surprised that this line:
App\Providers\TelescopeServiceProvider::class,
was not added again after the second try of installation command.
So I manually uncommented that line in config/app.php
and then
php artisan cache:clearphp artisan config:clear
and follow the official document for additional configs.
Now everything is fine and works well! Clapp it and follow me if this article is useful for you, I daily publish article about Laravel.
To remove Laravel Telescope completely :
You must first remove all the telescope reference in your code before running composer remove laravel/telescope.
- Check
config/app.php
, underproviders
array, remove the Telescope there. - In your
app/Providers/AppServiceProvider.php
is there aTelescopeServiceProvider
there? Remove that also. - Remove
telescope.php
inconfig
folder - Remove public/vendor/telescope
- Also have to remove
bootstrap/cache/config.php
to get rid of cache link toTelescopeServiceProvider
Then finally you can run composer remove laravel/telescope
.