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 :
- How To Validate Youtube Url In laravel Best Practical Example
- How To Get Last Record From The Laravel Collection Using last() Collection Method Possible all Example
- Looping Variable Laravel Blade File - $loop
- Import Export Database in JSON Format Laravel
- How to Install Laravel 10 With Video Tutorial
- Laravel pwa Integration Tutorial
- Attributes Set In Laravel Model
- Laravel Intervention Image
- How To Filter In Laravel Query Example
- Single Session User Login in Laravel