When you set TELESCOPE_ENABLED=false in .env, production may keep using the old value. If your deployment runs php artisan config:cache, Laravel reads a compiled configuration instead of loading .env on each request. Telescope can therefore keep collecting with the setting that was active when the cache was built.
This is not a Telescope bug. It is exactly what Laravel's configuration cache is designed to do.
Check the effective configuration
Start with the values Laravel actually uses, not only the value in your editor:
php artisan config:show telescope php artisan route:list --path=telescope The first command inspects Telescope's effective configuration. The second tells you whether the dashboard route is registered. They answer different questions: disabling Telescope's enabled option stops data collection, while route registration and authorization determine whether the dashboard can be reached.
Laravel's configuration-cache documentation is explicit: after configuration is cached, the application does not load .env during requests or Artisan commands. Changing .env alone is therefore not a reliable rollback.
Also check the dashboard response on a safe test environment:
curl -I https://your-domain.example/telescope A 403 means an authorization rule blocked the request. A 404 can mean the route is absent. A 200 or a login redirect tells you the route exists, but does not by itself prove that sensitive entries are exposed. Inspect the effective gate rather than guessing from a status code.
Why the leftover data matters
Telescope is built to record useful debugging context. Depending on the enabled watchers, that can include request headers, session and response data, raw SQL and bindings, exceptions, log entries, queued jobs, outgoing HTTP requests, and email previews.
On an LMS or another application handling personal data, those records can outlive the original debugging session. A temporary integration test can leave authentication details, student identifiers, query values, or email content in a debugging store that the normal application review never covers.
Laravel's Telescope documentation also warns that if APP_ENV is not set to production, the installation may be publicly available. For non-local environments, the viewTelescope gate controls dashboard authorization. Review that gate and its current allowlist; removing one temporary admin account is not a complete retirement check.
Retire Telescope in the right order
Set the intended production values. Use
TELESCOPE_ENABLED=falseand make sureAPP_ENV=production. If Telescope is only needed for development, follow Laravel's local-only installation guidance instead of deploying it as a production service.Rebuild the cached configuration. Clear the old cache and rebuild it from the corrected configuration:
php artisan config:clear php artisan config:cache Run this through the normal deployment process so web and queue workers use the same configuration. Do not edit the compiled cache file manually.
Verify collection, routing, and authorization separately. Repeat
config:show telescopeandroute:list --path=telescope. Confirm the effectiveenabledvalue is false and test theviewTelescopegate with an authorized and an unauthorized test account. A route returning403is not the same check as data collection being disabled.Deal with historical entries. Disabling collection does not delete what Telescope already stored. Laravel provides
telescope:prune; the default removes entries older than 24 hours, while--hourschanges that threshold. For example, a daily task that removes entries older than 48 hours is:
use Illuminate\Support\Facades\Schedule; Schedule::command('telescope:prune --hours=48')->daily(); Choose a retention period that matches your data-retention policy and verify that the scheduled task actually runs. Do not assume that pruning starts just because the command exists.
Add this to the deployment checklist
The important habit is to verify configuration after every rollback, not only after the initial installation. A useful production check has four assertions:
- the effective Telescope setting is disabled;
- the dashboard route and gate behave as intended;
-
APP_ENVis production; - old Telescope entries have an enforced retention policy.
That catches the difference between “we changed .env” and “production changed.” It also prevents a debug tool from becoming an undocumented second database for sensitive application data.
For Laravel-based learning platforms, pair that application-level review with external monitoring. GuardLMS's Laravel integration checks exposed debug output, security headers, TLS, DNS and uptime, and tracks framework and dependency vulnerabilities alongside your own Telescope and access-control review.
