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.
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:
Key architectural strengths:
illuminate.query, illuminate.request).DB::listen).JobWatcher, LogWatcher) and custom entry types.Misalignment risks:
telescope.entries_per_page).| 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:
Blockers:
formatForTelescope requires PHP 8.1+ named arguments.| 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:
SerializesModels trait or custom watchers for non-Eloquent jobs.localStorage..env)?| 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:
/api/telescope/entries) to fetch data client-side.TELESCOPE_DISPLAY_UI=false) and use CLI commands (telescope:entries).Pre-Integration:
telescope_entries and telescope_metrics tables..env: Set TELESCOPE_ENABLED=true and configure retention (e.g., TELESCOPE_RETENTION_DAYS=1).Installation:
composer require laravel/telescope
php artisan telescope:install
php artisan migrate
laravel/telescope:^4.x and adjust configuration.Configuration:
TelescopeServiceProvider to config/app.php.app/Providers/AuthServiceProvider.php.Post-Integration:
php artisan telescope:prune.TELESCOPE_IGNORE_ROUTES for sensitive endpoints.| 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+ |
How can I help you explore Laravel packages today?