tegos / laravel-telescope-flusher
telescope-flusher is a Laravel package that provides a simple Artisan command to completely flush all Telescope data from the database
Package info
github.com/tegos/laravel-telescope-flusher
pkg:composer/tegos/laravel-telescope-flusher
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^8.0
This package is auto-updated.
Last update: 2026-04-29 16:08:14 UTC
README
Laravel Telescope Flusher is a Laravel package providing an Artisan command that completely wipes all Telescope
data and reclaims disk space. Unlike telescope:prune (which deletes by age), it truncates every Telescope table and
runs OPTIMIZE TABLE on MySQL to release storage back to the engine.
Useful when telescope_entries grows to multi-GB sizes from heavy jobs or long development sessions.
Benchmark on 1,000,000 entries / 3,000,000 tags (MySQL 8.0):
telescope:cleartakes ~150 minutes and leaves 3.1 GB locked in.ibdfiles.telescope:flushfinishes in 1.21 seconds and shrinks the files to 428 KB. Reproduction script inbench/.
Read more:
- Why
telescope:clearIs Slow and How to Reclaim Disk in Seconds - the benchmark deep-dive - Efficiently Managing Telescope Entries with Laravel-Telescope-Flusher - the original post
Installation
Requirements: PHP 8.1+ · Laravel 10/11/12/13 · laravel/telescope installed (MySQL, PostgreSQL, SQLite supported).
You can install the package via Composer:
composer require tegos/laravel-telescope-flusher --dev
Usage
Once installed, you can run the following command to flush Telescope data:
php artisan telescope:flush
Behavior
- Only runs in local environments (prevents accidental execution in production).
- Checks if Telescope is installed before running.
- Truncates all Telescope-related tables.
- Optimizes the
telescope_entriestable (MySQL).
Compared to
telescope:prune(deletes rows older than--hours) andtelescope:clear(slow row-by-rowDELETE),telescope:flushusesTRUNCATEfor speed andOPTIMIZE TABLEto reclaim disk. InnoDB does not return space to the OS afterDELETE; it only marks it reusable.
Testing
You can run tests using:
composer test
Running tests in Docker
docker compose up -d docker compose exec app composer install docker compose exec app composer test
Contributing
Please see CONTRIBUTING for contribution guidelines.
Security
If you discover any security-related issues, please email tegosiv@gmail.com instead of using the issue tracker.
Credits
License
This package is open-source software licensed under the MIT License. See LICENSE for details.
