lisowiecw/filament-media-library
Filament Media Library provides a ready-to-use media manager for Filament panels: upload, browse, search, and organize files, then attach media to Eloquent models. It simplifies handling images and documents in admin resources with an intuitive interface.
Architecture fit. The package occupies the media path of a Laravel application: upload ingestion and sanitization, a storage/library layer, and a field-based picker surface rendered in the admin UI. v0.4.0 does not move that architecture; it consolidates three previously scattered concerns into single owners — Drop intake (all three drop surfaces plus the inline trigger and both tabs), Card painting (thumbnail, BlurHash, hash painting, in-flight state, once per field and once per asset), and TenantReach (the single answer to "may this field context attach these ids", shared by picker validation and AttachmentReconciler). From a TPM standpoint the release is a cohesion release with one security-driven forced upgrade and several behavioral convergences, not a re-platforming. That is a favourable shape: the integration seam (the field's own configuration) is explicitly unchanged.
Integration feasibility. Composer-level integration is trivial — one dependency constraint moves from enshrined/svg-sanitize ^0.22 to ^1.0, and there are no stated migrations or config changes. The real integration work is behavioral: (a) some SVGs that uploaded cleanly now get refused, (b) an attach path that previously surfaced a database foreign-key error now surfaces AttachRefused, and (c) five public-ish methods disappear (MediaPicker::upload(), LibraryGrid::thumbnailUsing(), pollable(), isPollable(), MediaPicker::getThumbnailUrl(), paintsThroughPipeline()). Each is a bounded, greppable change, but each can be a fatal error or a silent behavior shift in consumer code rather than a compile-time failure.
Technical risk.
0.22 retains whatever 0.22 produced, including content that the four now-published advisories describe. The package deliberately does not re-sanitize at rest. Upgrading the library closes the forward path and leaves the historical exposure open until assets are re-uploaded or re-encoded. Treat the dependency bump and the content backfill as two separate workstreams with separate owners.composer audit reported clean against 0.22.0 throughout because Packagist had not ingested the advisories. Our SCA signal was green while four exploitable classes were open. That is a process finding as much as a package finding.thumbnailUsing() being consulted for non-image assets lose that; the release itself flags this as the reason it is a minor rather than a patch.AttachRefused where a query exception previously surfaced. Any catch (QueryException) around attach code becomes dead, and any generic handler that logged-and-continued will now see a domain exception instead.href/src, unquoted url(), url() among other declarations in a style attribute (dropping the whole attribute, not the declaration), and remote @import/url() inside <style> text. The blast radius on a real icon/illustration library is unknown until measured.Key questions.
enshrined/svg-sanitize 1.0 raise the PHP floor or change its own public API in ways that constrain our runtime matrix?AttachRefused catchable via a stable base type, and does it implement a marker interface? The release promises both named constructors are caught together — confirm that holds for our handlers.Stack fit. Standard Composer/Laravel dependency; no new infrastructure, no queue or storage changes, no migration. The field-configuration API — the surface field authors actually write — is unchanged, so existing field definitions, templates and picker registrations need no edits. The release is pre-1.0, so a minor carrying behavior changes is within the project's stated contract, but our change-advisory process should not treat it as routine.
Migration path.
svg-sanitize ^1.0; verify PHP floor and lockfile diff.LibraryGrid / MediaPicker; any override of those methods is a hard break.catch (QueryException) and catch (\Illuminate\Database\... around attach, seed, job and import paths; widen to AttachRefused where the old behavior was "let the DB refuse".href, unquoted url(), style with mixed declarations, remote @import in <style>, mixed-case xlink:HrEf, element-dense document) and assert refusal/preservation behavior on staging before rollout.Compatibility. No schema or config delta expected. Runtime compatibility risk is confined to (a) PHP/dependency floor from the sanitizer major, (b) consumer code touching removed methods, (c) exception handling around attach paths. Behavior compatibility is not guaranteed for uploaded content or for non-image assets in custom-thumbnail fields.
Sequencing. Do the code inventory and the fixture tests first (day 1–2, cheap, catches the fatal-error class). Deploy the dependency bump to staging, then to production behind normal release process. Run the content inventory in parallel but land the backfill as a separate, tracked remediation with its own acceptance criteria — do not let the green build imply the stored-asset exposure is closed. Editor comms go out before the deploy, not with it.
Maintenance. We inherit a ^1.0 major constraint on a security-critical transitive dependency, which is the correct posture — the release explicitly refuses to leave 0.22 resolvable, and that decision should be preserved rather than "widened for flexibility" by a future maintainer. Add upstream-repository advisory watching to the dependency-review routine, because composer audit demonstrably lagged here; a clean audit is no longer sufficient evidence.
Support. Expect a bounded wave of "my SVG won't upload" tickets from editors and designers. The refusal names the file, which is good, but the remedy (re-export without the custom entity, make the remote reference local) needs to be in the help text and in the ticket macro. Separately expect questions about images disappearing from cards in fields with a custom thumbnailUsing() rule — that is a deliberate convergence, and it should be documented as such rather than handled ad hoc.
Scaling. Two real wins. The quadratic-to-linear sanitization on element-dense SVGs removes a CPU-exhaustion vector on the upload path, which matters if uploads are synchronous in the request cycle. The Upload tab's new room check stops over-capacity confirms from uploading assets that then sit unattached in the library — fewer orphans, less storage drift, less cleanup. Unifying reconciliation under TenantReach means a rule change propagates to both the picker and programmatic attach paths, which is the difference between one policy and two that can drift.
Failure modes.
Error: Call to undefined method in any consumer overriding or calling the removed methods.AttachRefused in queued jobs, seeders and imports that previously relied on a database error; these can become retry loops rather than clean failures if the handler treats unknown exceptions as retryable.Ramp-up. Low for field authors — configuration is untouched. Low-to-medium for application developers — mostly inventory work against a short, greppable list. Medium for editors and designers, who must learn a new refusal class and the re-export remedy, and medium for whoever owns the stored-asset remediation, since that work has no tooling and no automatic path by design.
How can I help you explore Laravel packages today?