aniftyco/laravel-attachments
Attach files to any Eloquent model in Laravel with a clean, expressive API. laravel-attachments stores attachments polymorphically with file metadata, so any model can own images, documents, or other files on any storage disk—no boilerplate or custom migrations required.
Verdict up front: At 13 stars and a composite score of ~17/100, this package should be treated as an unvetted internal utility, not a dependency. It is architecturally plausible and cheap to trial, but it does not clear the bar for adoption on a revenue-critical surface without a time-boxed spike and a documented exit path. The decision is not "is this good code" — it is "do we want to own the failure modes of automatic file lifecycle management for a single-maintainer package."
Architecture fit
HasFactory, SoftDeletes, and cast definitions, with no service container or framework-level surgery required.Integration feasibility
composer require, add a trait, define validation, point at a disk. A competent Laravel developer can have a working prototype in under a day.Technical risk
afterCommit and how it handles queue retries is a make-or-break detail.Model::where(...)->delete(), truncate(), raw SQL, or FK cascades. Any cleanup that depends on events will leak storage under normal operational patterns (bulk archival jobs, GDPR deletion scripts, data migrations). Storage leaks are cheap until they aren't — they surface as unexplained S3 spend months later.Key questions (route to the spike; each has a cheap empirical answer)
deleted, forceDeleted, or afterCommit? What happens on soft delete, restore, and transaction rollback?truncate handled — orphan-tolerant sweeper, or nothing?Stack fit
Migration path
AttachmentService / small interface, not the package trait directly. This is the single highest-leverage decision for exit cost and takes a day to do.Compatibility
composer.json and commit the lockfile. Do not accept floating constraints on a low-adoption dependency.Sequencing
spatie/laravel-medialibrary (the incumbent, ~5k stars, battle-tested, heavier but survivable) and a ~150-line in-house trait. For one-file-per-column needs, the in-house option is often the winning answer; for collections and conversions, medialibrary wins. Choose deliberately rather than by default.Maintenance
composer update. Laravel majors routinely break trait-based packages that hook model events.Support
Scaling
Failure modes (each needs an alert or a documented acceptance)
fileinfo extension differences between environments.Ramp-up
How can I help you explore Laravel packages today?