- How do I install tjmpromos/sortable-gallery in a Laravel application?
- Install it with Composer using composer require tjmpromos/sortable-gallery, then publish and run the package migrations. Typical setup also means adding the package trait or interface to the owning Eloquent model, attaching the gallery component to a Filament resource, and registering any plugin in your panel provider. Check the README for the exact publish tags and namespace because this is a small, personally maintained package rather than a framework-standard install.
- Which Filament versions does sortable-gallery support, including Filament v4?
- The package is built around a Filament admin interface, but the available evaluation does not confirm declared Filament constraints, so inspect composer.json before committing. Filament v3 to v4 introduced breaking form, table, and asset-registration changes, and a package pinned to ^3.0 inherits a migration deadline. If v4 is not supported, either fork it on a known-good Filament version or budget roughly a day per major upgrade.
- How do I attach a sortable gallery to an Eloquent model?
- Add the package trait or interface to the model that should own the gallery, then run the package migration that creates the gallery and ordering tables. In Filament, attach the gallery form or relation component to the resource that edits that model. The package is designed for one bounded owning model pattern, so keep the relation scoped rather than turning it into a general media library.
- How do I render a sortable gallery in a Blade view?
- The package is intended to render galleries in your views after images have been uploaded and ordered in Filament. Use the Blade component or helper the README exposes, or loop over the ordered gallery relation on the model and output image URLs from the configured disk. Verify the public URL and disk configuration in a staging environment before relying on it in production.
- Can I change the storage disk or path used for gallery images?
- Storage semantics are a key integration unknown: the package may assume a public disk, a configurable disk, or another media layer, so publish the config and inspect it first. If a disk setting exists, point it at your target disk or CDN-backed disk and test upload, serve, and delete paths. Do not assume local public storage maps cleanly to production without an integration test.
- How does drag-and-drop image ordering work and is the order persisted?
- The package provides drag-and-drop sorting in the Filament admin interface and persists an order for each gallery image, typically through an order column or a sortable dependency. Reordering is saved through the admin component rather than being a client-only visual effect. For concurrent editors, add a deterministic tie-breaker or unique index on the owning model and order value to avoid duplicate positions.
- What happens to gallery images when the parent model is deleted?
- Deleting a model or gallery record can leave orphaned image files on disk unless the package ships cleanup logic, which the evaluation flags as a risk rather than a confirmed feature. Add an observer-level cleanup hook or a scheduled prune job that removes files no longer referenced by a gallery row. Test deletion on the target disk because database cascade deletes do not remove stored files.
- Is tjmpromos/sortable-gallery actively maintained and safe for production?
- It is a narrow, personally maintained package with a low star count and no releases noted since April 2025, so treat it as high-quality sample code you are prepared to own. MIT licensing lets you vendor or fork it into an internal namespace if upstream activity stalls. For production, lock composer.json, audit transitive dependencies, and run an upload, serve, and delete test on your real disk.
- Can I use sortable-gallery for end-user or public image uploads?
- The package is designed as an admin-only Filament component, which is the correct containment boundary for its upload handling. Do not expose it to non-admin users without reviewing MIME validation, SVG handling, path traversal, and upload size limits. Livewire temporary uploads also inherit php.ini and Filament image-editor settings, so those are configuration hazards to test.
- When should I fork sortable-gallery instead of using it as a dependency?
- Fork or vendor it when you need guaranteed Filament major-version support, a specific disk or CDN strategy, or cleanup behavior the package does not ship. The blast radius is small, typically a migration, a trait on one or two models, and one Filament component, so owning the code is often cheaper than waiting on upstream. If you need a general media library, DAM, or CDN pipeline, choose a broader package such as spatie/laravel-medialibrary instead.