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) 

 [ ![Laravel Telescope Alternatives: Building a Lightweight Request Inspector with Middleware](https://cdn.msaied.com/216/9b6d240010b80483f072902dafcd216c.png) laravel middleware debugging 

### Laravel Telescope Alternatives: Building a Lightweight Request Inspector with Middleware

Telescope is powerful but heavy for production. Learn how to build a focused, low-overhead request inspector u...

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

 16 Jun 2026     1 min read  

  Read    

 ](https://msaied.com/articles/laravel-telescope-alternatives-building-a-lightweight-request-inspector-with-middleware) [ ![RAG Pipelines in Laravel: Chunking, Embedding, and Retrieval with pgvector](https://cdn.msaied.com/215/e037e13535aa77822f879ee829ec3f68.png) laravel ai pgvector 

### RAG Pipelines in Laravel: Chunking, Embedding, and Retrieval with pgvector

Build a production-ready Retrieval-Augmented Generation pipeline in Laravel using pgvector, OpenAI embeddings,...

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

 16 Jun 2026     3 min read  

  Read    

 ](https://msaied.com/articles/rag-pipelines-in-laravel-chunking-embedding-and-retrieval-with-pgvector) [ ![Laravel Pest: Architecture Tests, Mutation Testing, and Type Coverage in CI](https://cdn.msaied.com/214/0d4822fa8ee1765d0689e387dd849d92.png) laravel pest testing 

### Laravel Pest: Architecture Tests, Mutation Testing, and Type Coverage in CI

Go beyond feature tests. Learn how to enforce architectural rules, catch logic gaps with mutation testing, and...

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

 16 Jun 2026     4 min read  

  Read    

 ](https://msaied.com/articles/laravel-pest-architecture-tests-mutation-testing-and-type-coverage-in-ci) 

   [  ![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)
