Laravel 12 – Telescope Debugging Tool (Requests, Queries, Logs etc)
Laravel 12 – Telescope Debugging Tool (Requests, Queries, Logs etc)
In this tutorial, we will learn how to use Laravel 12 Telescope debugging tool to track requests, queries, exceptions, and logs, making debugging and monitoring your Laravel apps easier.
If you're a video person, feel free to skip the post and check out the video instead!
Quick Overview
This guide walks you through setting up Laravel Telescope in a fresh Laravel project with Livewire authentication. We start by creating a new Laravel 12 application using either the global Laravel installer or Composer, giving us a clean project structure with ready-to-use authentication. Once the project is ready, we navigate to its root directory to install Laravel Telescope, publish the necessary configuration files and assets, and run database migrations so Telescope can store logs and monitor various aspects of the application. After completing the setup, we test everything by starting the Laravel development server and visiting the Telescope dashboard in the browser, where we can explore requests, database queries, background jobs, and other key application events in real time. Following these steps provides a solid foundation for integrating Telescope, offering powerful tools to debug, monitor, and optimize your Laravel applications efficiently.
Step # 1 : Spin Up a New Laravel 12 Project with Livewire Authentication.
Let’s start fresh by setting up a new Laravel 12 application with authentication scaffolding. Laravel makes this quick with its starter kits. If you have the Laravel installer on your machine, you can generate a new project by running.
laravel new telescope
Alternatively, you can use Composer (no installer required)
composer create-project laravel/laravel --prefer-dist telescope
Once the project is created, you’ll be asked a few configuration questions.
- Starter Kit → Pick Livewire for authentication scaffolding.
- Auth Provider → Go with Laravel’s built-in authentication.
- Laravel Volt → Type yes to enable it.
- Testing Framework → Choose Pest for cleaner and modern testing.
- Npm install & build → Select no (we’ll handle that later).
At this point, your Laravel 12 application is ready with Livewire authentication, Blade views, and Pest for testing. With Volt enabled, you already have a clean and modern scaffolding in place, a solid foundation to start building your app right away.
Step # 2 : Navigate Into Your Laravel Project
Once the installation is complete, the next step is to move into your project’s folder. Open your preferred terminal (Command Prompt, Git Bash, or any shell you normally use) and switch to the root directory of your new Laravel app. For example, if your project is inside C:\xampp\htdocs\telescope, you would run.
cd c:xampp/htdocs/telescope
Make sure to adjust the path based on where you created your project. From here, all your Artisan commands, Composer installs, and build tools will run in the correct project environment.
Step # 3 : Add Laravel Telescope to Your Project.
Now it’s time to bring in Laravel Telescope. Start by pulling in the package via Composer.
composer require laravel/telescope
Once the installation is complete, publish Telescope’s configuration and assets using Artisan.
php artisan telescope:install
This command sets up all the necessary files and service providers so Telescope can hook into your application properly. Finally, migrate the database to create the tables that Telescope uses to store logs, requests, queries, and other debugging details.
php artisan migrate
After running these commands, Telescope will be fully integrated into your Laravel project, giving you a powerful dashboard to monitor and debug your application in real time.
Step # 4 : Install Frontend Dependencies.
With Telescope set up, the next step is to compile your frontend assets. Run the following commands inside your project directory.
npm install
npm run dev
The first command pulls in all the required Node.js packages, while the second compiles your CSS and JavaScript for development. Once this is done, your project will have all the frontend resources ready, and you can start working with a fully functional Laravel + Livewire setup. Open another instance of git bash or command line tool to run further commands.
Step # 5 : Run and Verify Telescope.
With everything in place, let’s confirm that Telescope is working. Start the built-in Laravel development server by running.
php artisan serve
When the server is up, open your browser and visit: http://127.0.0.1:8000/telescope. This will load the Telescope dashboard, where you can explore requests, logs, queries, and more, all in real time. If you see the dashboard, it means Telescope is successfully installed and ready to help you debug and monitor your application.
Now that the Telescope dashboard is open, we can see it in action. Let’s start by creating a new user account through your application’s registration form. After submitting the form, switch back to Telescope and look at the Requests panel. You’ll see the registration request logged in real time, showing details such as the route accessed, form input data, response status, and execution time. This makes it easy to verify that the account was created successfully and to inspect any potential issues immediately.
Next, head over to the Queries section. Here, Telescope lists all the database queries executed during the registration process. You can check which queries were run, how long they took, and the tables affected. This helps you identify any slow or redundant queries that could affect performance.
Once you’ve seen the registration request and the related queries in Telescope, you get a glimpse of the tool’s power. Beyond logging requests and database interactions, Telescope provides deep visibility into many aspects of your application. It tracks queued jobs and scheduled tasks, allowing you to monitor background processes and check whether they succeeded or failed. It also captures exceptions automatically, giving detailed error messages, stack traces, and relevant context to make debugging faster and more precise.
Additionally, Telescope can log emails, notifications, and other important actions, helping you verify that everything in your app is running as expected. All of this information is accessible through the intuitive /telescope dashboard, offering a centralized hub to monitor, debug, and optimize your Laravel application effectively.
Conclusion
By following this guide, you’ve successfully set up Laravel Telescope in a fresh Laravel 12 project with Livewire authentication. You installed the Telescope package, published its assets and configuration files, and ran the necessary database migrations to prepare your application for monitoring. After verifying the setup by accessing the Telescope dashboard, you can now track requests, database queries, queued jobs, exceptions, and other important events in real time. With Telescope integrated, you gain valuable insights into your application’s performance and can quickly identify and troubleshoot issues. From here, you can explore additional Telescope features or combine it with other logging and monitoring tools to further enhance your Laravel applications.
For complete details, the official Laravel Telescope documentation is a great resource.
For complete details, the official Laravel Telescope documentation is a great resource.
Share this with friends!
To engage in commentary, kindly proceed by logging in or registering
Subscribe to Our Newsletter
Stay ahead of the curve! Join our newsletter to see what everyone’s talking about.
0 Comments