Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Telescope Laravel Package

laravel/telescope

Laravel Telescope is a debug assistant for Laravel that gives deep visibility into app activity: incoming requests, exceptions, logs, database queries, queued jobs, mail, notifications, cache events, scheduled tasks, dumps, and more—ideal for local development.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

Laravel Telescope is architecturally aligned with Laravel applications due to its native integration as a first-party package. It leverages Laravel’s service provider, middleware, event listeners, and database-driven logging patterns, making it a seamless fit for:

  • Monolithic Laravel apps (Lumen excluded, as it lacks some Laravel core features).
  • Microservices with Laravel APIs (if centralized logging is acceptable).
  • Hybrid stacks (e.g., Laravel + Vue/React) via its Vite-based frontend and API-driven data exposure.

Key architectural strengths:

  1. Event-driven: Hooks into Laravel’s core events (e.g., illuminate.query, illuminate.request).
  2. Database-agnostic: Works with Eloquent, Query Builder, and raw SQL (via DB::listen).
  3. Modular: Extensible via watchers (e.g., JobWatcher, LogWatcher) and custom entry types.
  4. Performance-optimized: Uses chunking for large datasets and indexed queries for filtering.

Misalignment risks:

  • Non-Laravel PHP apps: Requires Laravel’s event system and Eloquent/Query Builder.
  • Headless APIs: Overhead of UI may not justify use in purely API-driven systems.
  • High-throughput systems: Telescope’s real-time UI could impact performance if not configured (e.g., telescope.entries_per_page).

Integration Feasibility

Integration Aspect Feasibility Notes
Laravel Core ⭐⭐⭐⭐⭐ Zero-config for Laravel 8+. Auto-registers routes/middleware.
Custom Watchers ⭐⭐⭐⭐ Requires PHP knowledge; documented but not trivial for complex use cases.
Database Schema ⭐⭐⭐⭐ Migrations provided, but may conflict with existing telescope_entries.
Authentication ⭐⭐⭐⭐ Integrates with Laravel’s auth gates (e.g., auth:api).
CI/CD Pipelines ⭐⭐⭐ May need exclusion in test environments (e.g., .env.TEST_TELESCOPE=false).
Third-Party Packages ⭐⭐⭐ Potential conflicts with packages using DB::listen (e.g., debug bars).

Critical dependencies:

  • Laravel 8.0+ (v5.x Telescope).
  • PHP 8.1–8.5 (as of v5.20.0).
  • Frontend stack: Vite (replaces Laravel Mix in v5.10.0+); requires Node.js for asset compilation.

Blockers:

  • Laravel Boost: Telescope v5.12.0+ ignores Boost routes, but older versions may conflict.
  • Custom Serialization: Overriding formatForTelescope requires PHP 8.1+ named arguments.

Technical Risk

Risk Area Severity Mitigation
Performance Overhead High Disable in production (TELESCOPE_ENABLED=false), limit entries per page.
Database Bloat Medium Configure retention (telescope.retention_days), use telescope:prune command.
Frontend Asset Conflicts Medium Exclude Telescope’s Vite assets from global compilation if using custom setup.
Authentication Bypass Critical Restrict to local env (TELESCOPE_DISALLOWED_ENVIRONMENTS=!local).
Version Skew High Pin Laravel/Telescope versions in composer.json (e.g., laravel/telescope:^5.20).

Hidden complexities:

  • Queue Job Tracking: Requires SerializesModels trait or custom watchers for non-Eloquent jobs.
  • CSRF Protection: Telescope routes are CSRF-exempt by default (v5.19.0+ fixes edge cases).
  • LocalStorage Collisions: Mitigated in v5.18.0 but may affect SPAs using localStorage.

Key Questions for TPM

  1. Environment Scope:
    • Should Telescope be enabled in staging (e.g., for QA debugging) or restricted to local only?
  2. Data Retention:
    • What’s the acceptable trade-off between debug data volume and database size?
  3. Authentication:
    • Will custom gates (e.g., role-based access) be needed beyond Laravel’s default?
  4. Performance:
    • Are there high-traffic endpoints where Telescope’s middleware could introduce latency?
  5. Alternatives:
    • Could Laravel Forge/Envoyer logs or Sentry replace Telescope for production?
  6. Customization:
    • Are there non-standard Laravel features (e.g., custom events) that require custom watchers?
  7. CI/CD:
    • Should Telescope be auto-pruned in CI or excluded entirely (e.g., via .env)?

Integration Approach

Stack Fit

Component Compatibility Notes
Laravel Core ⭐⭐⭐⭐⭐ Native support; no modifications needed.
Lumen ⭐⭐ Partial support (missing some Laravel features like events).
Livewire/Inertia.js ⭐⭐⭐⭐ Works but may require excluding SPA routes from Telescope tracking.
API Platforms ⭐⭐⭐ UI overhead may not justify use; consider API-only mode (TELESCOPE_IGNORE_ROUTES).
Queue Workers ⭐⭐⭐⭐ Tracks jobs but requires SerializesModels or custom watchers.
Frontend Frameworks ⭐⭐⭐ Vite-based UI may conflict with custom frontend setups.
Database ⭐⭐⭐⭐⭐ Supports MySQL, PostgreSQL, SQLite; no schema changes required.
Cache Drivers ⭐⭐⭐⭐ Tracks cache operations but may need CacheWatcher configuration.

Stack-specific recommendations:

  • For Laravel + Vue/React: Use Telescope’s API (/api/telescope/entries) to fetch data client-side.
  • For Headless APIs: Disable UI (TELESCOPE_DISPLAY_UI=false) and use CLI commands (telescope:entries).
  • For Microservices: Centralize Telescope in a debugging service and forward logs via HTTP.

Migration Path

  1. Pre-Integration:

    • Audit dependencies: Ensure Laravel 8.0+ and PHP 8.1+.
    • Backup database: Telescope creates telescope_entries and telescope_metrics tables.
    • Review .env: Set TELESCOPE_ENABLED=true and configure retention (e.g., TELESCOPE_RETENTION_DAYS=1).
  2. Installation:

    composer require laravel/telescope
    php artisan telescope:install
    php artisan migrate
    
    • For Laravel <8.0: Use laravel/telescope:^4.x and adjust configuration.
  3. Configuration:

    • Middleware: Add TelescopeServiceProvider to config/app.php.
    • Routes: Publish Telescope routes (optional for API-only setups).
    • Authentication: Configure gates in app/Providers/AuthServiceProvider.php.
  4. Post-Integration:

    • Test in staging: Verify no performance regressions.
    • Prune old data: Run php artisan telescope:prune.
    • Exclude routes: Use TELESCOPE_IGNORE_ROUTES for sensitive endpoints.

Compatibility

Compatibility Factor Status Details
Laravel Versions ✅ 8.0–13.x v5.x Telescope supports Laravel 12/13; v4.x for 7.x.
PHP Versions ✅ 8.1–8.5 v5.20.0+
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport