PHPackages                             harman/filament-disk-cleanup - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. harman/filament-disk-cleanup

ActiveLibrary[File &amp; Storage](/categories/file-storage)

harman/filament-disk-cleanup
============================

Clean up the storage on model updates

v1.0.0(10mo ago)04MITPHPPHP ^8.0

Since Sep 1Pushed 10mo agoCompare

[ Source](https://github.com/harman-codes/filament-disk-cleanup)[ Packagist](https://packagist.org/packages/harman/filament-disk-cleanup)[ RSS](/packages/harman-filament-disk-cleanup/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

This package aims to automatically remove associated files from the storage when a model with an attachment is deleted or updated in Filament. By leveraging Laravel's built-in lifecycle hooks, it ensures that orphaned files are efficiently handled and removed from the disk, reducing disk space consumption and improving overall system performance.

Requirements
------------

[](#requirements)

- PHP 8.0+
- Laravel 11+
- Filament v3 or v4

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

[](#installation)

You can install the package via composer:

```
composer require harman/filament-disk-cleanup
```

Usage
-----

[](#usage)

Use it in the model where you have an attachment. That's all.

It has two methods:

- Cleanup::delete($model, 'columnName');
- Cleanup::update($model, 'columnName');

For example : If you have an avatar column where you store the attachment in the User model, you can use it like this:

```
use Harman\FilamentDiskCleanup\Cleanup;
class User
{
//--
    protected static function booted()
    {
        static::deleted(function (User $user) {
            Cleanup::delete($user, 'avatar');
        });

        static::saved(function (User $user) {
            Cleanup::update($user, 'avatar');
        });
    }
//--
}
```

It automatically handles array of attachments. For example, if you have a files column where you store the multiple attachments in the Document model, you can use it like this:

```
use Harman\FilamentDiskCleanup\Cleanup;
class Document
{
//--
    protected static function booted()
    {
        static::deleted(function (Document $document) {
            Cleanup::delete($document, 'files');
        });

        static::saved(function (Document $document) {
            Cleanup::update($document, 'files');
        });
    }
//--
}
```

No extra configuration is required.

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance54

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

306d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88c32cde929f5951ad0eea953abaccca708747d2a088b00cdff3e63524e00512?d=identicon)[harman](/maintainers/harman)

---

Top Contributors

[![harman-codes](https://avatars.githubusercontent.com/u/50082974?v=4)](https://github.com/harman-codes "harman-codes (1 commits)")

---

Tags

laravelfilamentharman-codesfilament-disk-cleanupfilament-storage-cleanup

### Embed Badge

![Health badge](/badges/harman-filament-disk-cleanup/health.svg)

```
[![Health](https://phpackages.com/badges/harman-filament-disk-cleanup/health.svg)](https://phpackages.com/packages/harman-filament-disk-cleanup)
```

###  Alternatives

[mwguerra/filemanager

A full-featured file manager package for Laravel and Filament v5 with dual operating modes, drag-and-drop uploads, S3/MinIO support, and comprehensive security features.

7620.3k3](/packages/mwguerra-filemanager)[3x1io/filament-browser

File &amp; Folders &amp; Media Browser With Code Editor

491.3k](/packages/3x1io-filament-browser)[achyutn/filament-storage-monitor

A server storage monitoring widget for Filament.

281.6k](/packages/achyutn-filament-storage-monitor)[slimani/filament-media-manager

A media manager plugin for Filament.

126.9k](/packages/slimani-filament-media-manager)[josefbehr/filament-spatie-media-library-croppie

A filament form field for image upload using spatie media library and croppie.js

126.9k](/packages/josefbehr-filament-spatie-media-library-croppie)[mmes-design/filament-file-manager

A beautiful file manager plugin for Filament. Browse, upload, rename, move and delete files with ease.

163.1k](/packages/mmes-design-filament-file-manager)

PHPackages © 2026

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