tjmpromos/sortable-gallery
A Laravel package for adding sortable image galleries to your app. Attach images to Eloquent models, reorder them with drag-and-drop sorting, and render galleries in your views. Streamlines gallery image management and custom ordering.
Architecture fit. tjmpromos/sortable-gallery is a narrow, opinionated feature package: a persisted, orderable set of images attached to an Eloquent model, surfaced through a Filament admin UI. It fits cleanly into the "admin panel owns content" pattern common in Laravel/Filament applications, where the public site reads from the same tables. It is not a general media library, a DAM, or a CDN pipeline — it solves one bounded problem (upload, order, delete, crop/convert maybe) inside one admin surface. That narrowness is the package's main architectural virtue: the blast radius is a migration, a trait on one or two models, and one Filament form/relation component.
The low star count and the personal namespace (tjmpromos) tell us this is a battle-tested-in-one-context extraction rather than a community-maintained standard. Treat it as high-quality sample code you are prepared to own, not as an upstream dependency you can lean on. For a TPM the relevant question is not "is it good?" but "is the code small enough that forking it costs less than rebuilding it?" At a glance, probably yes — a gallery component plus a pivot/order column is a few hundred lines.
Integration feasibility. Typical integration is mechanical: composer require, publish config/migrations, add a trait or interface to the owning model, attach the component in a Filament resource, register a plugin in the panel provider. The unknowns that determine real effort:
^3.0 only, you inherit a migration deadline on Filament's release cadence rather than your own.spatie/laravel-medialibrary under the hood? Disk/CDN assumptions are the most common source of "works locally, breaks in prod."order column with a reorder endpoint is simple and portable; a spatie/eloquent-sortable dependency is fine but adds a transitive upgrade surface. Either way, concurrent drag-and-drop needs a tie-breaker policy.php.ini/upload_max_filesize, Livewire temp-disk, and Filament's image editor settings. These are configuration hazards, not code hazards, but they cause incidents.Feasibility verdict: feasible for a single pilot panel in 1–3 days, contingent on one of the key questions below resolving favorably.
Technical risk.
| Risk | Severity | Likelihood | Mitigation |
|---|---|---|---|
| Bus factor of one; no releases since Apr 2025 | High | Medium | Vendor the code into an internal namespace; MIT permits it |
| Filament major-version breakage | Medium | High (over 12–18 months) | Fork on a known-good Filament version; budget ~1 day per Filament major |
| Silent assumption of a specific disk/path | Medium | Medium | Integration test that uploads, serves, and deletes on the target disk |
| Orphaned files on model/record deletion | Medium | Medium | Add observer-level cleanup or a scheduled prune job |
Reorder race conditions / duplicate order values |
Low | Medium | Unique index on (model_id, order) or deterministic tie-break in query |
| Hidden transitive dependencies (medialibrary, intervention/image) | Medium | Medium | Lock and audit composer.lock; check for abandoned transitive packages |
Security exposure is modest but non-zero: the component handles file uploads, so MIME validation, SVG handling, and path traversal are the areas to review before exposing it to non-admin users. It is admin-only by design, which is the correct containment boundary — do not reuse it for end-user uploads without a review.
Key questions to resolve before committing:
composer.json, and is v4 supported or planned?spatie/laravel-medialibrary, custom columns, or a JSON blob for image metadata?public?Stack fit. The package only makes sense if Filament is already the admin layer. If the team is on Nova, Backpack, or a bespoke Blade admin, this package is irrelevant and the correct decision is "do not adopt" — you would be importing a UI paradigm you cannot host. For a Filament shop, it is a strong fit: it uses the same conventions (panel plugins, form components, resource pages) the team already knows, so onboarding cost is near zero for anyone who has written a Filament resource.
Migration path. Because the package owns its own table(s), migration is additive and reversible:
Banner or CaseStudy), not the flagship content type.If you are replacing an existing hand-rolled gallery, keep the old read path alive behind a feature flag until the new component has served a full week of production traffic. The write path (ordering) is the risky part; the read path is cheap to dual-run.
Compatibility. Pin explicitly: PHP minor, Laravel major, Filament major. Do not allow ^ ranges to float across Filament majors — a composer update in CI should never be able to change the admin UI's component API. Verify DB support (MySQL 8 and Postgres both handle the ordering column; SQLite is fine for tests but masks concurrency issues). Confirm the package does not require a specific queue driver or filesystem adapter beyond what you already operate.
Sequencing. Recommend a four-step gate:
packages/internal/gallery under your namespace, add a single feature test covering upload → reorder → delete → file cleanup. This converts an unmaintained dependency into an owned, tested module at low cost.The decision gate is simple: if the spike fails on Filament version or disk assumptions and the maintainer is unresponsive, build the 200-line internal version instead. At this scale, forking and rebuilding cost roughly the same, and rebuilding removes the bus-factor risk entirely.
Maintenance. Expect to own this. Last release April 2025 with 12 stars implies low ongoing investment; a single Filament major release can strand the package. Budget a recurring, low-but-nonzero allowance — roughly 0.5–1 engineer-day per quarter for dependency bumps, plus ~1 day per Filament major. After vendoring, the practical burden is "keep it compiling," which is manageable for a component this small. Establish a named owner (a specific engineer, not "the platform team") and a calendar reminder to review the upstream repo quarterly; if upstream ships a v4-compatible release, consider re-adopting to shed the fork.
Support. No commercial support, MIT license, community-only. That is acceptable only because the code is small enough to read in an afternoon. Do not adopt it for anything with a regulatory or revenue-critical surface where you'd need an SLA. Internal documentation matters more than usual here: record the pinned Filament version, the disk configuration, and the ordering semantics in your runbook so a future on-call engineer isn't reverse-engineering a package nobody remembers choosing.
Scaling. The admin surface is inherently low-QPS — a handful of editors, not user traffic — so the package is not a scaling concern on the write side. The scaling profile that matters is image delivery, which the package only partly addresses:
Failure modes. The realistic incidents, in rough order of probability:
php.ini limits changed; the component surfaces this as a generic admin error. Mitigate with a synthetic upload check in staging.Ramp-up. Low for anyone with Filament experience — roughly half a day to be productive, a day to be confident enough to modify. The real ramp-up cost is the reverse-engineering phase for a new owner six months later, which is why vendoring plus a one-page internal README (what it owns, what it assumes, how to upgrade) is worth the modest upfront effort. Editors need separate, minimal training: drag to reorder, delete, save — and explicit guidance on image dimensions and file size, since the component will happily accept whatever the upload limits permit.
Bottom line for the product decision. The package's narrow scope and MIT license make it a low-consequence bet: cheap to pilot, cheap to fork, cheap to abandon. Its risks are structural rather than technical — single maintainer, Filament-version coupling, unclear upstream longevity. Adopt only if (a) Filament is already the admin layer, (b) the dependency audit is clean, and (c) the team accepts ownership via a vendored fork. Score it as an accelerator of an already-planned gallery feature, not as a reason to build one.
How can I help you explore Laravel packages today?