- Can I use Laravel Telescope in production, or is it strictly for development?
- Telescope is designed for local development only. Laravel explicitly discourages production use due to risks like data leakage, performance overhead, and unbounded storage growth. For staging, consider enabling it temporarily with strict retention policies and masking sensitive data.
- How do I install Telescope in a Laravel 10+ project?
- Run `composer require laravel/telescope`, then execute `php artisan telescope:install` to publish config and assets. Finally, run `php artisan migrate` to create the required database tables. No manual route setup is needed—it registers automatically via middleware.
- Does Telescope work with Laravel 9 or older versions?
- Telescope officially supports Laravel 10+. For Laravel 9, you may need to manually adjust dependencies or use a forked version, but compatibility isn’t guaranteed. Always check the [Laravel docs](https://laravel.com/docs/telescope) for version-specific notes.
- How can I mask sensitive data (e.g., passwords, tokens) in Telescope logs?
- Use the `telescope:mask` command to define sensitive fields (e.g., `php artisan telescope:mask 'password' 'api_token'`). This automatically redacts those values in request/response payloads. Combine this with auth gates to restrict access to sensitive data.
- What’s the performance impact of Telescope in a high-traffic Laravel app?
- Telescope introduces minimal overhead in development, but logging every request/query can slow down staging environments. Monitor the `telescope_entries` table size and adjust `entries_per_minute` in `config/telescope.php` to limit retention. Disable it entirely in production.
- Can I customize Telescope’s UI or add my own debug panels?
- Yes, Telescope’s frontend uses Vite (since v5.10.0), so you’ll need Node.js to compile custom assets. For backend customizations (e.g., adding watchers for domain-specific events), extend the `TelescopeServiceProvider` or create custom watchers by implementing the `Watcher` interface.
- How do I restrict access to Telescope’s dashboard in a multi-tenant app?
- Modify the `auth` gate in `config/telescope.php` to use a custom callback (e.g., `auth:api` for admin users). For multi-tenant setups, ensure the gate checks tenant-specific permissions. Always enable CSRF protection for the `/telescope` route via `VerifyCsrfToken` middleware.
- What alternatives to Telescope exist for Laravel debugging?
- For lightweight debugging, try **Laravel Debugbar** (browser extension) or **Ray** (PHP extension). For monitoring, **Sentry** or **Laravel Horizon** (for queues) are production-ready. If you need a simpler log viewer, **Laravel Log Viewer** or **Monolog** integrations are alternatives.
- How can I archive or clean up old Telescope entries to prevent database bloat?
- Set `entries_per_minute` in `config/telescope.php` to limit retention (e.g., `60` for 1 hour). For older data, manually truncate the `telescope_entries` table or use Laravel’s `SoftDeletes` trait with a scheduled job to purge entries older than 30 days.
- Does Telescope support custom database connections or only the default one?
- Telescope uses the default database connection configured in Laravel’s `.env`. To use a custom connection, override the `connection` property in `config/telescope.php` or extend the `TelescopeServiceProvider` to specify a different connection during registration.