DevOps

/laravel-agent:telescope:setup

Setup Laravel Telescope for debugging

Overview

Setup Laravel Telescope for elegant debugging with request inspection, exceptions, logs, database queries, jobs, mail, notifications, and cache operations.

Usage

/laravel-agent:telescope:setup [--local-only] [--with-pruning]

Examples

/laravel-agent:telescope:setup                    # Full setup
/laravel-agent:telescope:setup --local-only       # Only enable in local environment
/laravel-agent:telescope:setup --with-pruning     # Add scheduled pruning

What Gets Configured

  • Request Watcher - HTTP requests with headers, payload, response
  • Exception Watcher - All exceptions with stack traces
  • Query Watcher - Database queries with bindings and time
  • Model Watcher - Eloquent model events
  • Job Watcher - Queued job execution and failures
  • Mail Watcher - Sent emails with preview
  • Notification Watcher - All notifications
  • Cache Watcher - Cache operations
  • Log Watcher - Log entries

Installation

# Install Telescope
composer require laravel/telescope

# Publish assets
php artisan telescope:install
php artisan migrate

Authorization

// TelescopeServiceProvider
protected function gate(): void
{
    Gate::define('viewTelescope', function ($user) {
        return $user->isAdmin();
    });
}

Commands

# Clear all entries
php artisan telescope:clear

# Prune old entries
php artisan telescope:prune --hours=48

# Publish assets (after updates)
php artisan telescope:publish

Environment

TELESCOPE_ENABLED=true
TELESCOPE_PATH=telescope

See Also