Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Media Action Laravel Package

hugomyb/filament-media-action

Filament Media Action lets you display video, audio, PDFs, images and more directly in Filament via an action. It auto-detects file extensions and selects the right player, works in forms, tables and infolists, and supports options like autoplay.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit The package is a thin, presentation-layer addition to an existing Filament panel: one Action class, a Blade modal view, and Alpine-driven loading state. It introduces no tables, migrations, service configuration, or domain coupling — it renders media that already exists at a URL we supply. That gives it a very low blast radius and a cheap exit path (remove the action, delete the package). Where it fits well is media-heavy back-office surfaces: document/compliance evidence review, training or tutorial video links, product asset inspection, and approval workflows where a reviewer needs to see the file before signing off. It also composes with Filament's own primitives (extraModalFooterActions, ->url(), ->openUrlInNewTab()), which means it can be the "viewer" half of a review-and-decide pattern rather than a dead-end widget. It is not a fit for public-facing surfaces, API responses, or anything outside a Filament admin panel — this is an internal-tooling dependency, and should be scoped and budgeted that way.

Integration feasibility High on paper. composer require, auto-discovery, optional view and translation publishing, usable anywhere Filament Actions are accepted (tables, forms, infolists, prefixes/suffixes). The one hard constraint is Filament major pinning: ^3.0 for Filament v3, latest for v4. That means the package's release cadence becomes a gate on our own framework upgrade cadence. A half-day spike is enough to establish feasibility; the work is not integration effort, it is compatibility validation.

Technical risk

  • Bus factor of one. 56 stars and zero dependents means no external production validation and no vendor. Treat it as a community utility we may end up owning. MIT license makes fork-and-patch viable.
  • Heuristic media-type detection. The changelog is a catalogue of detection edge cases (query parameters, missing extensions, header casing, "complex" MIME types), each fixed by a patch release rather than exposure as configuration. Expect recurrence on unusual URL shapes.
  • Server-side Content-Type probing. The extension-less-URL fallback implies outbound HTTP requests during rendering. That introduces modal-open latency, egress, timeout behaviour, and a potential SSRF surface if any URL is ever user-influenced. It also fails for auth-protected or signed URLs. This is the single highest-value thing to verify in the spike.
  • Browser divergence disguised as features. disableDownload() / disableFullscreen() / noremoteplayback are controlsList flags and are explicitly Chromium-only. They must not be evaluated or documented as access controls — the URL is still retrievable.
  • Mobile/iOS fragility. The release history already contains iPhone audio spinner, iPhone video playback, and Alpine .load is not a function fixes. Mobile admin usage is the riskiest path.
  • PDF delivery depends on the browser's native viewer via <embed>, which is CSP-sensitive and inconsistent on mobile.

Key questions

  1. Is Content-Type detection server-side per modal open? Is it cached, does it follow redirects, send credentials, and what is the timeout?
  2. What CSP entries are required (frame-src for YouTube, object-src/frame-src for PDF, media-src)?
  3. Are assets registered through Filament's asset pipeline, and do they survive filament:assets / Vite builds?
  4. Do our media URLs require signing or expiry? If so, either ->mediaType() bypass or a proxy route is mandatory.
  5. Does the maintainer have a stated policy/cadence for Filament major releases, and who merges community PRs?
  6. Accessibility: can we add alt text, captions, and keyboard focus handling via the published view? WCAG 1.2.2 is a hard requirement in many orgs.
  7. Does action-within-action nesting behave cleanly, or does it stack modals?

Verdict: adopt conditionally — suitable for internal admin panels, contingent on the spike confirming CSP compatibility, latency without server-side probing, and iOS behaviour. Do not adopt as a default pattern until one low-risk resource has been in production for a release cycle.

Integration Approach

Stack fit Laravel 11 + Filament v3/v4 + Livewire + Alpine + Tailwind. The package is PHP, Blade, and Alpine only — no Node build step on our side (verify). It fits an existing Filament panel with zero architectural change; it does not fit Inertia, API, or public web surfaces.

Migration path Effectively greenfield. No schema change, no data backfill, no cutover — existing media URLs keep working, and records without a URL simply don't render the action (guard with ->visible(fn ($record) => filled($record->url))). The only migration-like concern is Filament major alignment: upgrading Filament forces a package major bump in the same change. Encapsulate usage behind our own thin subclass (e.g. App\Filament\Actions\MediaViewerAction extends MediaAction) so that a swap, fork, or abandonment is a single-file edit rather than a sweep of every resource.

Compatibility Pin the package major to the Filament major (^3.0 vs. latest) and pin the minor to a version we have tested — the 3.1.1.x line shipped frequent patch releases, so floating on * or dev-main is not acceptable for a production panel. Verify Livewire and PHP version alignment against the installed Filament release before committing.

Sequencing

  1. Spike (0.5–1 day, branch). Wire three real records: a private/S3 PDF, a YouTube link, and an mp4. Test Chrome, Firefox, Safari, and iOS Safari. Capture CSP requirements and modal-open latency with and without remote detection.
  2. Harden. Publish the modal view so we own the markup (alt text, captions, loading and error states). Add an "Open in new tab" footer action to every MediaAction as a fallback — the README's own example demonstrates the pattern.
  3. Pilot. Roll out to one read-only infolist viewer behind a feature flag.
  4. Expand. Add to review/approval tables using footer-action chaining.
  5. Standardise. Document the pinning rule and add "bump media action with Filament" to the upgrade runbook.

Operational Impact

Maintenance Small code surface, but real dependency maintenance: we inherit a third-party package tracking Filament's majors. Publish the view to insulate against markup churn; keep a fork branch ready. Review every changelog on upgrade rather than relying on semver, and pin to a specific tested patch.

Support Community-only, single maintainer, no SLA. Internal support burden is low but non-zero; the canonical ticket will be "media won't play in the modal." The cheapest resilience tactic is the new-tab fallback action on every instance, which converts a blocked modal into a recoverable user action.

Scaling Rendering is client-side, so the real scaling load lands on object storage and CDN egress, not app servers — with one exception: if media-type detection probes remote URLs per modal open, every user interaction becomes an outbound request. Mitigate by storing a media_type on the record and passing ->mediaType() explicitly, bypassing detection entirely for known assets. This is a latency and cost lever as much as a scaling one.

Failure modes to instrument or design out

  • Expired/signed URL → 403 inside the player with no useful message.
  • Extension-less or query-parameter URLs → "Unsupported media."
  • Autoplay blocked by browser policy → silent non-play; default autoplay off, use preload(false).
  • CSP blocks the iframe/embed → permanent loading spinner; needs a distinct error state in the published view.
  • Large files without HTTP range support → slow load, broken seeking.
  • iOS/Safari playback and mobile PDF viewer gaps.
  • Filament assets not rebuilt after deploy → unstyled modal.
  • YouTube embeds raise privacy/cookie and third-party-availability questions in regulated environments.

Ramp-up Very low. Any developer fluent in Filament Actions is productive in one to two hours; the README plus screenshots cover the API surface. The non-obvious cost is the compatibility testing in the spike, which is browser and CSP work rather than package learning — budget it as QA time, not developer education.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style