Filament Storage Monitor: Track Disk Usage in Laravel | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    Filament Storage Monitor: Track Disk Usage From Your Filament Dashboard        On this page       1. [  Monitor Server Disk Usage Directly in Your Filament Panel ](#monitor-server-disk-usage-directly-in-your-filament-panel)
2. [  Registering Disks ](#registering-disks)
3. [  Per-Disk Authorization ](#per-disk-authorization)
4. [  Compact Mode ](#compact-mode)
5. [  Error Handling ](#error-handling)
6. [  Known Limitation ](#known-limitation)
7. [  Key Takeaways ](#key-takeaways)

  ![Filament Storage Monitor: Track Disk Usage From Your Filament Dashboard](https://cdn.msaied.com/218/406457e6fb1b112de329987f6fdaae0f.png)

 [  Composer Pacakge ](https://msaied.com/articles?category=composer-pacakge) [  Filament ](https://msaied.com/articles?category=filament)  #Filament   #Laravel   #PHP   #Dashboard Widget   #Server Monitoring   #Open Source  

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

     16 Jun 2026      3 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   Monitor Server Disk Usage Directly in Your Filament Panel  ](#monitor-server-disk-usage-directly-in-your-filament-panel)
2. [  02   Registering Disks  ](#registering-disks)
3. [  03   Per-Disk Authorization  ](#per-disk-authorization)
4. [  04   Compact Mode  ](#compact-mode)
5. [  05   Error Handling  ](#error-handling)
6. [  06   Known Limitation  ](#known-limitation)
7. [  07   Key Takeaways  ](#key-takeaways)

 Monitor Server Disk Usage Directly in Your Filament Panel
---------------------------------------------------------

Filament Storage Monitor is a community plugin that embeds a disk-usage widget into any Filament admin panel. Rather than reaching for an external monitoring tool, you can surface storage stats—powered by native PHP filesystem functions—right alongside the rest of your dashboard.

Registering Disks
-----------------

You register the plugin inside your panel's `->plugins()` call. Two convenience methods cover the most common cases:

- `addDisk(path, label)` — watches any absolute filesystem path.
- `laravelDisk(name, label)` — resolves a disk defined in `config/filesystems.php`.

```php
use AchyutN\FilamentStorageMonitor\FilamentStorageMonitor;

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

```

For richer customization, the `add()` method accepts a `Disk` DTO where you can attach a Filament color and a Heroicon to each entry:

```php
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 data can be sensitive, so the plugin provides two authorization layers:

- A `visible()` closure on the plugin hides the **entire widget** when it returns `false`.
- An `isVisible` closure on an individual disk hides **only that entry**.

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

```

Compact Mode
------------

If dashboard real estate is tight, compact mode strips each disk entry down to its label and remaining free space:

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

```

The widget also respects the standard Filament layout helpers—`columnSpan()`, `columnStart()`, `sort()`, and `lazy()`—so it slots cleanly into any grid arrangement.

Error Handling
--------------

By default, an unresolvable path (a missing mount point, for example) is caught silently and the widget continues to render. During development you may want exceptions to surface instead:

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

```

Passing a closure lets you enable strict behavior only in local environments without touching production.

Known Limitation
----------------

Because the plugin reads **partition-level** stats via PHP's filesystem functions, two paths that live on the same partition will report identical total and free space figures. Per-directory size calculation is on the roadmap for a future release.

Key Takeaways
-------------

- Register any filesystem path or Laravel disk with `addDisk()` / `laravelDisk()`.
- Use the `Disk` DTO for per-disk colors and Heroicons.
- Gate visibility at the widget level or per individual disk with closures.
- Compact mode reduces each entry to label + free space.
- Silent error handling by default; opt into exceptions per environment.
- Partition-level stats mean two paths on the same partition share the same numbers.

The source code, documentation, and contribution guidelines are available on [GitHub](https://github.com/achyutkneupane/filament-storage-monitor).

---

*Source: [Laravel News — Filament Storage Monitor](https://laravel-news.com/filament-storage-monitor-track-disk-usage-from-your-filament-dashboard)*

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Ffilament-storage-monitor-track-disk-usage-from-your-filament-dashboard&text=Filament+Storage+Monitor%3A+Track+Disk+Usage+From+Your+Filament+Dashboard) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Ffilament-storage-monitor-track-disk-usage-from-your-filament-dashboard) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  Can I monitor multiple disks or partitions with Filament Storage Monitor?        Yes. You can chain multiple `addDisk()` or `laravelDisk()` calls, or use the `Disk` DTO with `add()`, to register as many paths as you need. Note that two paths on the same partition will report the same total and free space because the plugin reads partition-level stats. 

      Q02  How do I restrict who can see disk usage data in the Filament widget?        Use the `visible()` closure on the plugin to hide the entire widget based on any condition, and the `isVisible` closure on an individual disk entry to hide just that row. Both closures receive the standard Laravel auth context, so you can check roles or permissions as usual. 

      Q03  What happens if a registered path does not exist or cannot be read?        By default the plugin catches the error silently and continues rendering the rest of the widget. You can call `throwException()` (optionally with a closure scoped to local environments) to re-enable exceptions when you want failures to surface during development. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![Pest 5 Released: Test Impact Analysis, Agent Verification, and Evals](https://cdn.msaied.com/493/a1d6434093b945e8a3291eb09c09e768.png) Pest PHP Testing PHP 8.4 

### Pest 5 Released: Test Impact Analysis, Agent Verification, and Evals

Pest v5 lands with the TIA engine that cut Laravel Cloud's 19,000-test suite from 3 minutes to 5 seconds, plus...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 31 Jul 2026     4 min read  

  Read    

 ](https://msaied.com/articles/pest-5-released-test-impact-analysis-agent-verification-and-evals) [ ![Job Batching, Chaining, and Rate-Limited Middleware in Laravel Queues](https://cdn.msaied.com/489/89d47dc6b618d5435f9d7f333b75e922.png) laravel queues jobs 

### Job Batching, Chaining, and Rate-Limited Middleware in Laravel Queues

Go beyond basic dispatch: learn how to compose Laravel job batches with callbacks, chain dependent jobs safely...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 30 Jul 2026     4 min read  

  Read    

 ](https://msaied.com/articles/job-batching-chaining-and-rate-limited-middleware-in-laravel-queues-3) [ ![Laravel Observers vs. Model Events: Choosing the Right Hook for Domain Side-Effects](https://cdn.msaied.com/488/451564d0a43aa33809619fa299027222.png) laravel eloquent domain-events 

### Laravel Observers vs. Model Events: Choosing the Right Hook for Domain Side-Effects

Model events and observers look similar but behave differently under bulk operations, transactions, and test i...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 30 Jul 2026     4 min read  

  Read    

 ](https://msaied.com/articles/laravel-observers-vs-model-events-choosing-the-right-hook-for-domain-side-effects) 

   [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
