Watch Youtube Video (HINDI) :
What is a laravel telescope?
In simple term laravel telescope is a debugger inside the laravel application every incoming and outgoing request will notice and listed, this is used for developing purposes or sometimes for production mode also, it is helpful to the developer for the local environment while they working, or when the application in developing mode.
What is the laravel telescope used for?
Laravel telescope provides insight into application incoming requests, database queries, queue job, email sending, notification, cache, exception, server error, syntax, dump data in this all the activity wondering and noticed all time.
Now we will see how to integrate the telescope in our application with the help of composer, we will install "laravel/telescope" composer in the laravel app for getting get libraries.
Step 1. Install Composer
composer require laravel/telescope
After installing telescope composer, we will publish its asset files using the "telescope: install" command, after that you should run migrate command to create a migration table for the store telescope data in the database, to get record history.
php artisan telescope:install
php artisan migrate
After installing the telescope artisan command, if you got going to the telescope default migration file, we should call the "Telescope::ignoreMigrations" method in the register method in the application App\Providers\AppServiceProvider class, you may still expose the migration telescope table using the below command :
php artisan vendor:publish --tag=telescope-migrations
Step 2. Local Installation Only(Optional)
If you wish to use it only for local development purposes only, follow this step, This installs only for locally development environment purposes only.
composer require laravel/telescope --dev php artisan telescope:install php artisan migrate
Step 3. Configuration
After the published assets file and migration are successfully in the database, we will add a "TELESCOPE_ENABLED" property in the .env file. you may disable data collection using a telescope in the application locally or production using enable configuration option..env
the configuration file will be located in the "config/telescope.php". this configuration file allows you to config the watcher option. change configuration as per your requirement.config/telescope.php
'enabled' => env('TELESCOPE_ENABLED', true),
Step 4. Start & Check
Start your development server using the below command :
php artisan server
Run the below localhost URL in your browser and test
We always thanks to you for reading our blogs.
Dharmesh Chauhan(Swapinfoway Founder)
We Are Also Recommending You :
- Queue Laravel Command Tutorial Example
- How to return laravel collection in json format - toJson() Method - Laravel Collection
- Laravel 10 Http Guzzle Request Crud Example
- Error : You need to install the imagick extension to use this back end
- Laravel 6 Create Custom Helper Function
- How to Upload Multiple Images In Laravel 10
- Laravel Tap Payment Gateway Integration Tutorial Example
- Cashfree Payment Gateway Integration In Laravel
- [issue] Possible All Way To Change Asset Path And Add Public To Asset Path In Laravel
- Attributes Set In Laravel Model