Filament Storage Monitor: Track Disk Usage From Your Filament Dashboard

Last updated on by

Filament Storage Monitor: Track Disk Usage From Your Filament Dashboard image

Filament Storage Monitor is a plugin that adds a dashboard widget to your Filament panel for watching server disk usage. It reads storage stats with native PHP filesystem functions and renders them as a widget that fits in with the rest of your panel, with support for multiple partitions, custom labels, and more.

Registering Disks

You register the plugin in your panel and tell it which paths to watch. The addDisk() method takes a path and label directly, while laravelDisk() resolves a disk from your config/filesystems.php:

use AchyutN\FilamentStorageMonitor\FilamentStorageMonitor;
 
return $panel
->plugins([
FilamentStorageMonitor::make()
->addDisk('/mnt/data', label: 'Data Partition')
->laravelDisk(name: 'public', label: 'Media Storage'),
]);

For more control over a single disk, the add() method accepts a Disk DTO where you can set a color and a Heroicon alongside the path and label:

use AchyutN\FilamentStorageMonitor\DTO\Disk;
use AchyutN\FilamentStorageMonitor\FilamentStorageMonitor;
use Filament\Support\Colors\Color;
use Filament\Support\Icons\Heroicon;
 
FilamentStorageMonitor::make()
->add(
Disk::make('web-root')
->path('/var/www/html')
->label('Web Root')
->color(Color::Green)
->icon(Heroicon::ComputerDesktop),
)
->addDisk(
path: '/mnt/backup',
label: 'Backups',
color: Color::Blue,
icon: Heroicon::ArchiveBox,
);

Per-Disk Authorization

Disk usage can be sensitive server information, so the plugin lets you gate visibility at two levels. A visible() closure on the widget controls whether the whole widget renders, and an isVisible closure on an individual disk hides just that entry:

FilamentStorageMonitor::make()
->visible(fn () => auth()->user()->is_admin) // Hide entire widget
->addDisk(
path: '/var/www/html',
label: 'App Files',
isVisible: fn () => auth()->user()->can('view_server_stats') // Hide specific disk
);

Compact Mode

For a smaller footprint on the dashboard, compact mode reduces each disk to its label and free space:

FilamentStorageMonitor::make()
->compact();

The widget also exposes the usual layout controls, columnSpan(), columnStart(), sort(), and lazy(), for placing it on the dashboard.

Error Handling

By default, a path that can't be resolved (a missing mount, for example) won't crash your panel, the widget catches the error and keeps rendering. If you'd rather surface those problems during development, throwException() re-enables exceptions, and it accepts a closure so you can scope strict behavior to local environments:

FilamentStorageMonitor::make()
->throwException(fn () => app()->isLocal());

One limitation worth noting: because the package reads partition-level stats, two paths on the same partition will report the same total and free space. Directory-specific size calculation is planned for a future release.

You can find the source, documentation, and contribution guidelines on GitHub.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

The latest

View all →
LaraOwl: Self-Hosted Monitoring for Laravel Applications image

LaraOwl: Self-Hosted Monitoring for Laravel Applications

Read article
Subscriptionify: Feature-Based Subscription Management for Laravel image

Subscriptionify: Feature-Based Subscription Management for Laravel

Read article
Toolkit: Reusable AI Tools for the Laravel AI SDK image

Toolkit: Reusable AI Tools for the Laravel AI SDK

Read article
Laracon US 2026 Reveals Its Full Speaker Lineup image

Laracon US 2026 Reveals Its Full Speaker Lineup

Read article
The State of PHP 2026 Survey Is Now Open image

The State of PHP 2026 Survey Is Now Open

Read article
Version-Controlled Documentation Inside Your Laravel App with Laradocs image

Version-Controlled Documentation Inside Your Laravel App with Laradocs

Read article