Telescope provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, and more.
Official Documentation Link: https://laravel.com/docs/telescope
composer require laravel/telescope
php artisan telescope:install
php artisan migrate
config/telescope.php file, add in the auth middleware that you would like to use for the authorization.'auth:admin' will use the laravel default authentication middleware with the 'admin' guard for the authorization on Telescope.'middleware' => [
'web',
'auth:admin',
Authorize::class,
],
app/Providers/TelescopeServiceProvider.php file, there is an authorization gate definition.protected function gate()
{
Gate::define('viewTelescope', function ($user) {
return ($user->can('operation.telescope'));
});
}
protected function gate()
{
Gate::define('viewTelescope', function ($user) {
return in_array($user->email, [
'support@etctech.com.my'
]);
});
}
telescope:prune Artisan command to run daily:$schedule->command('telescope:prune --hours=48')->daily();