PHPackages                             spatie/laravel-disk-monitor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spatie/laravel-disk-monitor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spatie/laravel-disk-monitor
===========================

Monitor metrics of Laravel disks

0.0.2(5y ago)251705MITPHPPHP ^7.4CI failing

Since May 15Pushed 5mo ago4 watchersCompare

[ Source](https://github.com/spatie/laravel-disk-monitor)[ Packagist](https://packagist.org/packages/spatie/laravel-disk-monitor)[ Docs](https://github.com/spatie/laravel-disk-monitor)[ Fund](https://spatie.be/open-source/support-us)[ GitHub Sponsors](https://github.com/spatie)[ RSS](/packages/spatie-laravel-disk-monitor/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (9)Versions (3)Used By (0)

Monitor metrics of Laravel disks
================================

[](#monitor-metrics-of-laravel-disks)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1fa41d5a0890b0ff3c976e086b1766888fb45f05bbfb7b8d3255b6860b924b9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d6469736b2d6d6f6e69746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-disk-monitor)[![Test Statusd](https://github.com/spatie/laravel-disk-monitor/workflows/run-tests/badge.svg)](https://github.com/spatie/laravel-disk-monitor/workflows/run-tests/badge.svg)[![Code Style Status](https://github.com/spatie/laravel-disk-monitor/workflows/Check%20&%20fix%20styling/badge.svg)](https://github.com/spatie/laravel-disk-monitor/workflows/Check%20&%20fix%20styling/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/0e7606ded4d93a1e7cee26a30f55e86ab617c54f7146e3145b243d493896edb5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d6469736b2d6d6f6e69746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-disk-monitor)

laravel-disk-monitor can monitor the usage of the filesystems configured in Laravel. Currently only the amount of files a disk contains is monitored.

This package was initially build in the "Let's build a package together" video of the [Laravel Package Training](https://laravelpackage.training) video course.

If you've seen the entire video course, and want to practice creating a PR on this repo, please do so!

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/01127936f5739c838688e0f753f5a3f6e1870aeb8e95c421ddc07d97c94ed363/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d6469736b2d6d6f6e69746f722e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-disk-monitor)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require spatie/laravel-disk-monitor
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Spatie\DiskMonitor\DiskMonitorServiceProvider" --tag="migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Spatie\DiskMonitor\DiskMonitorServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    /*
     * The names of the disk you want to monitor.
     */
    'disk_names' => [
        'local',
    ],
];
```

Finally, you should schedule the `Spatie\DiskMonitor\Commands\RecordsDiskMetricsCommand` to run daily.

```
// in app/Console/Kernel.php

use \Spatie\DiskMonitor\Commands\RecordsDiskMetricsCommand;

class Kernel extends ConsoleKernel
{
    protected function schedule(Schedule $schedule)
    {
       // ...
        $schedule->command(RecordsDiskMetricsCommand::class)->daily();
    }
}
```

Usage
-----

[](#usage)

You can view the amount of files each monitored disk has, in the `disk_monitor_entries` table.

If you want to view the statistics in the browser add this macro to your routes file.

```
// in a routes files

Route::diskMonitor('my-disk-monitor-url');
```

Now, you can see all statics when browsing `/my-disk-monitor-url`. Of course, you can use any url you want when using the `diskMonitor` route macro. We highly recommand using the `auth` middleware for this route, so guests can't see any data regarding your disks.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance50

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~68 days

Total

2

Last Release

2172d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (41 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (8 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (6 commits)")[![alexmanase](https://avatars.githubusercontent.com/u/10696975?v=4)](https://github.com/alexmanase "alexmanase (5 commits)")[![mohammad19khodaei](https://avatars.githubusercontent.com/u/30317757?v=4)](https://github.com/mohammad19khodaei "mohammad19khodaei (3 commits)")[![i-bajrai](https://avatars.githubusercontent.com/u/3688374?v=4)](https://github.com/i-bajrai "i-bajrai (1 commits)")[![niveshsaharan](https://avatars.githubusercontent.com/u/2552126?v=4)](https://github.com/niveshsaharan "niveshsaharan (1 commits)")

---

Tags

spatielaravel-disk-monitor

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spatie-laravel-disk-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-laravel-disk-monitor/health.svg)](https://phpackages.com/packages/spatie-laravel-disk-monitor)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.0k1](/packages/mike-bronner-laravel-model-caching)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
