How to Set Up & Use Laravel Telescope for Debugging and Monitoring

Ever wondered what’s happening behind the scenes in your Laravel app? Laravel Telescope gives you full visibility into requests, database queries, exceptions, jobs, mail, notifications, and more—all in one elegant dashboard. Whether you’re debugging or…


This content originally appeared on DEV Community and was authored by RANA SAHA

Ever wondered what’s happening behind the scenes in your Laravel app? Laravel Telescope gives you full visibility into requests, database queries, exceptions, jobs, mail, notifications, and more—all in one elegant dashboard. Whether you’re debugging or optimizing performance, Telescope is a must-have tool for Laravel developers.

Step 1: Install Telescope
Run this Composer command in your Laravel project directory:

composer require laravel/telescope --dev

The --dev flag ensures Telescope is installed only in your local environment.

Step 2: Publish Telescope Assets
After installation, run:

php artisan telescope:install

Then migrate the database to create the required tables:

php artisan migrate

Step 3: Secure Telescope in Production
Telescope should not be publicly accessible in production. Laravel allows you to define a gate to limit access:

protected function gate()
{
    Gate::define('viewTelescope', function ($user) {
        return in_array($user->email, [
            'admin@example.com',
        ]);
    });
}

Only authorized users will be able to view Telescope if enabled in production.

Step 4: Access the Telescope Dashboard
Start your local server:

php artisan serve

Then open Telescope in your browser:

http://localhost:8000/telescope

You’ll see tabs like Requests, Queries, Exceptions, Logs, Mail, and more.

Step 5: Explore Telescope Features

  • Requests: Monitor incoming HTTP requests and responses
  • Exceptions: Track errors with full stack traces
  • Queries: View SQL queries and execution times
  • Jobs & Queues: Debug queued jobs and failures
  • Cache: Inspect cache hits and misses
  • Mail & Notifications: See emails and notifications sent by your app
  • Logs: Centralized log entries for easier debugging

Step 6: Manage Telescope Data
Telescope stores data in your database. To avoid it growing too large, prune old entries:

php artisan telescope:prune --hours=48

You can also schedule pruning automatically in app/Console/Kernel.php:

protected function schedule(Schedule $schedule)
{
    $schedule->command('telescope:prune --hours=48')->daily();
}

Conclusion

Laravel Telescope is an essential tool for Laravel developers. It helps you debug queries, track exceptions, monitor jobs, and optimize application performance. Start using it today and see exactly what’s happening inside your application.

You can also read this tutorial on my blogger website
for more Laravel guides and updates.


This content originally appeared on DEV Community and was authored by RANA SAHA


Print Share Comment Cite Upload Translate Updates
APA

RANA SAHA | Sciencx (2025-10-19T14:28:19+00:00) How to Set Up & Use Laravel Telescope for Debugging and Monitoring. Retrieved from https://www.scien.cx/2025/10/19/how-to-set-up-use-laravel-telescope-for-debugging-and-monitoring-2/

MLA
" » How to Set Up & Use Laravel Telescope for Debugging and Monitoring." RANA SAHA | Sciencx - Sunday October 19, 2025, https://www.scien.cx/2025/10/19/how-to-set-up-use-laravel-telescope-for-debugging-and-monitoring-2/
HARVARD
RANA SAHA | Sciencx Sunday October 19, 2025 » How to Set Up & Use Laravel Telescope for Debugging and Monitoring., viewed ,<https://www.scien.cx/2025/10/19/how-to-set-up-use-laravel-telescope-for-debugging-and-monitoring-2/>
VANCOUVER
RANA SAHA | Sciencx - » How to Set Up & Use Laravel Telescope for Debugging and Monitoring. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/19/how-to-set-up-use-laravel-telescope-for-debugging-and-monitoring-2/
CHICAGO
" » How to Set Up & Use Laravel Telescope for Debugging and Monitoring." RANA SAHA | Sciencx - Accessed . https://www.scien.cx/2025/10/19/how-to-set-up-use-laravel-telescope-for-debugging-and-monitoring-2/
IEEE
" » How to Set Up & Use Laravel Telescope for Debugging and Monitoring." RANA SAHA | Sciencx [Online]. Available: https://www.scien.cx/2025/10/19/how-to-set-up-use-laravel-telescope-for-debugging-and-monitoring-2/. [Accessed: ]
rf:citation
» How to Set Up & Use Laravel Telescope for Debugging and Monitoring | RANA SAHA | Sciencx | https://www.scien.cx/2025/10/19/how-to-set-up-use-laravel-telescope-for-debugging-and-monitoring-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.