Installing Laravel Telescope only in development environment
Pull the package via composer:
composer require laravel/telescope --dev
Publish its assets:
php artisan telescope:install
Run database migration:
php artisan migrate
In /config/app.php remove the following line from Application Service Providers array list:
App\Providers\TelescopeServiceProvider::class,
No add the following in your app/Providers/AppServiceProvider.php
:
use App\Providers\TelescopeServiceProvider;
And in the register()
method:
if ($this->app->isLocal()) {
$this->app->register(TelescopeServiceProvider::class);
}
That’s all and you are good to go!!