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

Maintainers

Package info

github.com/tegos/laravel-telescope-flusher

pkg:composer/tegos/laravel-telescope-flusher

Statistics

Installs: 1 083

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 0

v1.0.3 2026-04-06 09:52 UTC

README

Laravel Telescope Flusher Banner

Latest Version on Packagist Total Downloads Tests PHP Version Laravel Version Software License

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.

telescope:clear vs telescope:flush, 1M entries benchmark

Benchmark on 1,000,000 entries / 3,000,000 tags (MySQL 8.0): telescope:clear takes ~150 minutes and leaves 3.1 GB locked in .ibd files. telescope:flush finishes in 1.21 seconds and shrinks the files to 428 KB. Reproduction script in bench/.

Read more:

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_entries table (MySQL).

Compared to telescope:prune (deletes rows older than --hours) and telescope:clear (slow row-by-row DELETE), telescope:flush uses TRUNCATE for speed and OPTIMIZE TABLE to reclaim disk. InnoDB does not return space to the OS after DELETE; 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.

Donate