Download the PHP package maxkhim/laravel-storage-dedupler without Composer
On this page you can find all versions of the php package maxkhim/laravel-storage-dedupler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maxkhim/laravel-storage-dedupler
More information about maxkhim/laravel-storage-dedupler
Files in maxkhim/laravel-storage-dedupler
Package laravel-storage-dedupler
Short Description Laravel package for deduplication files in storage and analyze potential disk space savings
License MIT
Informations about the package laravel-storage-dedupler
Dedupler - Laravel package to prevent file duplications
Stop storing duplicate files in your Laravel application.
Tired of seeing the same file stored multiple times? When users upload duplicates, your storage bloats, cloud bills grow, backups take longer, and data consistency suffers.
Dedupler is an elegant Laravel package that solves this once and for all. It automatically prevents file duplicates using SHA-1 hashing and provides a beautiful polymorphic API to manage your attachments.
β¨ Why Dedupler?
- β‘ Laravel Native β Drop-in integration with your existing Eloquent models and Storage drivers.
- π« True Deduplication β SHA-1 hashing guarantees exactly one physical copy per file.
- π Polymorphic Magic β Link a single physical file to multiple models effortlessly.
- πΎ Storage & Cost Saver β Slash your disk usage and speed up your backups.
- π― Developer-First API β Clean, intuitive methods that just work out of the box.
π Quick Start
1. Install via Composer
(Optional) Analyse legacy storage directory
Finds duplicate files by SHA1 hash in directory and subdirectories and calculate potential disk space savings
2. Init package
This command make all necessary migrations, and verifies application configuration (storage, models, etc.) to ensure the package is ready to use
π§ How to use
1. Use Facade Dedupler to Store Deduplicated files
2. Add Trait to Your Model to keep deduplicated files attached to models
About Deduplication
When you upload the same file multiple times:
3. Attach existing files to models by SHA1 hash
If you already know the SHA-1 hash of a file (e.g., from a previous upload or an API response), you can attach it directly to any model without re-uploading the file.
Note: The file must already exist in the Dedupler storage.
4. Detach unique files from models
Remove the association between a model and a file. The physical file remains in storage and is only deleted when no other models reference it (depending on your garbage collection settings).
Ecosystem
Dedupler is designed to integrate seamlessly with popular Laravel packages. Here are the integration:
- Filament Plugin A ready-to-use Filament form component for deduplicated file uploads.
π§Ή Zero-Maintenance Cleanup (Enabled by Default)
You don't need cron jobs or manual scripts to keep your storage clean.
By default, Dedupler automatically deletes the physical file when the very last model detaches it. This guarantees you never pay for "ghost files" left behind after a user or post is deleted. If multiple models share the same file, it stays safely in storage until the last link is broken.
Prefer to handle cleanup manually via the dedupler:prune command? You can easily disable this auto-delete behavior via an environment variable:
π§Ή Keeping Your Storage Lean
Deduplication is only half the battle. When you delete a model (like a Post or User), the physical file might remain in your storage, becoming an "orphan". Over time, these orphaned files silently eat up your disk space.
Dedupler ships with a powerful, garbage collector to keep your storage perfectly clean:
β€οΈ Support the Project
If Dedupler saved you disk space, cloud costs, or just a few hours of debugging, consider giving the repository a star β. Itβs the best way to show your appreciation and help other developers discover this package. Also, you can make an issue.
Featured In & Video Tutorials
- π₯ Video Review: Laravel Package: Storage Dedupler to Save Disk Space by Laravel Daily (Povilas Korop)
- π° Laravel News (2026): Prevent Duplicate File Uploads With Laravel Storage Dedupler
- π° Laravel News (2025): Prevent Duplicate Files with the Dedupler Package for Laravel
π£οΈ API Reference
Enable RESTapi endpoint to check file existence
License
The MIT License (MIT).
All versions of laravel-storage-dedupler with dependencies
laravel/framework Version ^10.0|^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.15.0