How to Install Telescope In Laravel ?
Hi Guys,
In this tutorial,I will learn you how to use telescope in laravel.you can easy and simply use telescope in laravel application.
You can create laravel website and application then useful get debug and information rediable formate provide to laravel telescope.
You can use Laravel Telescope to debug your requests, exceptions, databases, cache, and much more in real time by accessing a specific route in your local environment.
Installing Laravel Telescope:
First step,you can install package in composer.
composer require laravel/telescope
If you are only using Telescope in your local environment you can add the --dev flag as below
composer require laravel/telescope --dev
You’ll then need to publish its assets and run a database migration using the following:
php artisan telescope:install
php artisan migrate
If you will use local environment then remove this line Application Service Providers section.
/config/app.php
App\Providers\TelescopeServiceProvider::class,
Then add to provider following
app/Providers/AppServiceProvider.php
use App\Providers\TelescopeServiceProvider;
And register() method
if ($this->app->isLocal()) {
$this->app->register(TelescopeServiceProvider::class);
}
If you are using Telescope in a production environment then by default only specified users will be able to access the Telescope dashboard. These can be added in the gate() method of the
app/Providers/TelescopeServiceProvider.php
protected function gate()
{
Gate::define('viewTelescope', function ($user) {
return in_array($user->email, [
'[email protected]',
]);
});
}
you can choose specify id in array.
return in_array($user->id, [
1, 2, 3,
]);
Now you can run using bellow command:
php artisan serve
Open bellow URL:
http://localhost:8000/telescope
It will help you....
- How to Notifications With database Driver in Laravel 11?
- How to Send Email Via Notification in Laravel 11?
- How to Install and Configure Laravel 11 Debugbar?
- How to Like Dislike System in Laravel 11?
- How to Paginate a Model with Relationship in Laravel 11?
- Laravel 11 Upload Files to Amazon S3 Example
- Laravel 11 Send WhatsApp Messages Example
- Laravel 11 Rest API Authentication Using JWT Tutorial