Installing Laravel Telescope only in development environment

James Bhatta
Nov 26, 2020

--

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!!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

James Bhatta
James Bhatta

Written by James Bhatta

Manoj Bhatta. PHP developer often working in Laravel. Loved PHP just because I cant wait until compiler processes my code.

No responses yet

Write a response