Rati Rukhadze has published Vacuum, a PostgreSQL monitoring and schema-linting package for Laravel. Instead of adding new instrumentation, it queries statistics PostgreSQL already collects internally, through views such as pg_stat_user_tables, pg_stat_activity and pg_stat_statements, and turns the results into a list of problems with the SQL needed to fix each one.

terminal
php artisan vacuum:check
php artisan vacuum:check --fail-on=warning # critical, warning, info, or never
php artisan vacuum:check --format=json # score, grade, deductions, findings

The package applies 13 advisor rules covering issues like transaction ID wraparound risk, table bloat, dead tuples, unused indexes and slow statements. Findings feed into an overall health score out of 100. Results appear either in a Blade dashboard at the /vacuum route or through a dedicated plugin for Filament 4 and 5.

Two Artisan commands bring the checks into automation: vacuum:check can fail a build when it hits critical findings, and vacuum:lint flags schema problems such as unindexed foreign keys during CI runs. Thresholds are configurable in config/vacuum.php, for example dead_tuple_ratio defaults to 0.20 and slow_query_milliseconds defaults to 500. A history feature stores scheduled snapshots to track trends and forecast future issues, and a companion set of 13 lessons explains common PostgreSQL problems using the developer's own database tables as examples, including N+1 query patterns.

Vacuum 1.2.0 requires PostgreSQL 14 and Laravel 11 or newer. The pg_stat_statements extension is optional; without it, the dashboard simply notes that it is missing. Installation runs through Composer followed by an install command. The dashboard is open by default only in the local environment; access elsewhere requires a custom callback registered via the Vacuum::auth() method, for example restricting the page to authenticated admin users.