When developing a Laravel application, debugging and monitoring can be challenging. This is where Laravel Telescope comes in—a powerful debugging assistant that provides deep insights into your app’s requests, database queries, and much more.
In this guide, we’ll explore what Laravel Telescope is, how to install it, and how to use it effectively to improve your development workflow.
Laravel Telescope is an official debugging tool by Laravel that helps developers monitor and inspect:
It provides a beautiful UI where you can see detailed logs and analyze your application's performance in real-time.
Getting started with Laravel Telescope is simple. Follow these steps:
Run the following command in your Laravel project directory:
composer require laravel/telescope --dev
Since Telescope is mainly used for development, it’s recommended to install it as a dev dependency (--dev
).
Next, publish the configuration and migration files using:
php artisan telescope:install
This command will create the necessary database tables to store Telescope’s data.
Now, migrate your database:
php artisan migrate
This ensures that Telescope can store logs and other monitoring data in your database.
Once installed, you can access Telescope by visiting:
http://your-app.test/telescope
Here, you’ll see a dashboard displaying logs, queries, exceptions, and more.
cache
operations (get
, put
, forget
).kernel.php
.Laravel Telescope is not recommended for production, as it logs sensitive data.
To restrict access, modify your app/Providers/TelescopeServiceProvider.php
:
protected function gate() { Gate::define('viewTelescope', function ($user) { return in_array($user->email, [ 'admin@example.com', ]); }); }
Now, only specific users (e.g., admin@example.com
) can access Telescope.
If you want to completely disable Telescope in production, update your .env
file:
TELESCOPE_ENABLED=false
Alternatively, you can remove Telescope using:
composer remove laravel/telescope
And delete the database tables using:
php artisan migrate:rollback --step=1
Laravel Telescope is an essential tool for Laravel developers, providing a robust debugging and monitoring solution. Whether you're working on a small project or a large-scale application, Telescope helps you gain deep insights into your application's performance, track issues efficiently, and optimize your workflow.
✅ Easy to install and use
✅ Provides deep insights into your app
✅ Helps track performance issues
✅ Improves debugging efficiency
If you’re working on a Laravel project, give Telescope a try—it can save you hours of debugging time! 🚀
composer require laravel/telescope --dev
. After installation, run php artisan telescope:install
and migrate the database using php artisan migrate
./telescope
in your Laravel application's URL (e.g., http://yourdomain.com/telescope
).config/telescope.php
. You can exclude specific requests, queries, jobs, or exceptions to optimize storage and performance.