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

Media Library Laravel Package

artisanpack-ui/media-library

A Laravel media library for handling uploads, storage, and image conversions, with a UI-friendly API for attaching and managing files across your application.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • v1.5.0 stays within standard Laravel package patterns: a queueable event, Eloquent columns on Media, a service-layer status transition, an Artisan backfill command, and a shared upload path across helper/trait/Livewire/HTTP entry points. This is a good fit for Laravel applications already using the media library.
  • MediaUploaded remains the most strategically useful backend addition: it decouples downstream enrichment such as AI alt-text generation from the upload request lifecycle. TPM value is that feature teams can subscribe with ShouldQueue listeners without forcing synchronous work into uploads.
  • Optimization status tracking denormalizes pipeline state for UI badges and reporting. That improves consumer experience but creates a schema-level contract around optimization_status, byte counts, formats, and error text. Treat those fields as public API for planning and support.
  • v1.6.0 is a frontend/Javascript-layer release with no PHP, schema, or event-contract changes. The enabled option on useMediaPicker (React and Vue) formalizes a data-fetching contract the package previously left implicit: fetches are now deferrable and gated on consumer intent. That is architecturally the right move — it pushes request timing to the component that knows when the picker is visible.
  • The MediaModal change is a behavioral default, not just an additive option. Because MediaModal now passes its own open state into enabled automatically, any app that mounts a closed modal and relied on data arriving in the background will observe the first open as a loading event. Additive API, changed default behavior.
  • The Vue composable accepting a ref or getter is consistent with Vue idiom and keeps reactivity in the consumer's hands. The React autoFetch: false StrictMode fix and the Vue first-filter-change fix are correctness repairs to existing options, not new surface.
  • The release-workflow change (queuing docs/changelog imports on the ArtisanPack UI docs site) is CI-only and skipped when DOCS_API_TOKEN is unset. Zero runtime impact; it is a publication-pipeline dependency, not a package feature.

Integration feasibility

  • Likely a conventional Composer upgrade plus package migration. Feasibility is high for apps on supported Laravel/PHP versions, but depends on how package migrations are loaded/published and whether the media table is large.
  • Event consumption is straightforward for teams already running queues. The backfill command is a sensible affordance for legacy libraries, but it is an operational step, not just a code upgrade.
  • TypeScript additions for OptimizationStatus and MediaOptimization reduce frontend drift if consumers adopt them. v1.6.0 does not change these types.
  • v1.6.0 requires a frontend asset rebuild and JS dependency bump, and is independently shippable from the v1.5.0 schema work. Teams that deferred the frontend half of v1.5.0 can take v1.6.0 on its own; teams mid-migration should not bundle it into the same change window as the media-table migration.

Technical risk

  • Six new columns on the media table may cause migration locking or write pressure on large libraries. Defaults, nullability, indexes, and JSON/format-column support across MySQL/PostgreSQL/SQLite need verification. (Unchanged in v1.6.0.)
  • media:backfill-optimization-status marks existing image rows as optimized. If run incorrectly or incompletely, it can misrepresent historical optimization state. Batching, resumability, and dry-run visibility are key questions. (Unchanged in v1.6.0.)
  • The event fires from every upload entry point. Teams already listening to ap.mediaLibrary.uploaded could accidentally duplicate AI alt-text work unless they migrate or disable the old listener. (Unchanged in v1.6.0.)
  • Queue retries need idempotency. A retried MediaUploaded listener could generate duplicate alt text or duplicate downstream records. (Unchanged in v1.6.0.)
  • processImage() sets failed on exception but still surfaces the exception. That is correct for observability, but upload UX may show failure after the media record already exists. Status may not capture partial format generation. (Unchanged in v1.6.0.)
  • New in v1.6.0 — deferred-fetch default. Apps with E2E or component tests asserting that mounting a modal triggers /api/media will now fail or silently pass against an empty list. Any consumer that reads picker results synchronously after mount without awaiting the first open needs review.
  • New in v1.6.0 — deferred-action semantics. Page changes and refresh() calls made while closed are queued and applied on next open. That is sensible, but it means a refresh() issued against a closed modal does not guarantee fresh data at the moment of the call. Consumers assuming synchronous invalidation should re-check.
  • New in v1.6.0 — first-open latency is now user-visible. Previously the fetch happened off-screen; now it happens when the user opens the picker. If the consuming UI does not render a loading state on first open, this reads as a regression to end users even though it is a net efficiency win.
  • New in v1.6.0 — enabled is a footgun if mis-wired. A consumer passing a value that never becomes true, or a Vue getter that does not track correctly, produces a permanently empty picker with no error. Worth an explicit guard or dev warning from the package.
  • No deprecations or breaking changes are called out in either release, but the overlap between the existing synchronous ap.mediaLibrary.uploaded hook and the queueable event still needs an explicit migration stance.

Key questions

  • Are the v1.5.0 migrations additive and safely reversible? Are new columns indexed, nullable, and defaulted as expected?
  • Is the backfill command chunked, resumable, rate-limited, and able to target date ranges or specific media IDs?
  • Does MediaUploaded dispatch after database commit? What payload does it carry? Can a listener failure affect the upload response?
  • Is image optimization synchronous in the request or already queued? Who sets pending, and are status transitions atomic under concurrent processing?
  • What is the supported Laravel/PHP/database matrix, and is there an upgrade guide for teams using custom Media models or overriding MediaResource?
  • How should teams avoid double work if they currently use ap.mediaLibrary.uploaded for AI alt-text?
  • Are non-image rows intentionally null, and does the UI render them as N/A without generating support noise?
  • v1.6.0: Is the MediaModal auto-wiring of open → enabled opt-outable, or must consumers use a bare useMediaPicker to restore eager fetching? Documenting the escape hatch matters for teams that intentionally prefetch.
  • v1.6.0: Does the picker expose a loading/pending state for the first open, and is it documented for consumers building custom modal chrome?
  • v1.6.0: What are the minimum supported React and Vue versions, and is React StrictMode double-invocation now covered by tests for both autoFetch paths?
  • v1.6.0: Is the Vue enabled ref/getter typed, and does it handle undefined gracefully?
  • v1.6.0: Does a failed docs/changelog import silently degrade, and does it ever gate a release? Who owns the DOCS_API_TOKEN and what happens on rotation?

Integration Approach

Stack fit

  • Best fit is a Laravel app already on ArtisanPackUI MediaLibrary, using Livewire or the package HTTP upload path, with queue workers available for ShouldQueue listeners. Teams without queue infrastructure can still upgrade, but the event's main benefit is reduced until workers exist.
  • Frontend consumers should adopt the new TypeScript types rather than hand-rolling optimization status shapes. Apps with custom media resources or custom upload controllers need regression testing because all entry points funnel through MediaUploadService.
  • v1.6.0 raises the value of the frontend half of the integration. Any app rendering MediaModal in a persistent layout, dashboard shell, or settings page now gets automatic request suppression while closed. That is a direct win for apps with heavy /api/media volume and is the strongest reason to take v1.6.0 promptly rather than batched into a later UI refresh.

Migration path

  1. Pin the current package version and review v1.5.0 migrations in staging.
  2. Upgrade Composer dependency to v1.5.0 and run migrations during a low-traffic window or standard deploy hook. Confirm new columns and defaults.
  3. Deploy application code, then register MediaUploaded listeners and ensure queue workers are running.
  4. Run media:backfill-optimization-status against legacy libraries in batches, monitoring runtime and error output.
  5. Enable optimization status badges and rebuild frontend assets/types.
  6. Disable or migrate any existing synchronous ap.mediaLibrary.uploaded AI alt-text listener to avoid duplicate work.
  7. Then, as a separate change: bump to v1.6.0, rebuild frontend assets, and audit modal mounting points for the new deferred-fetch behavior. Verify loading states on first open and remove any test assumptions of fetch-on-mount.

Compatibility

  • Verify PHP/Laravel support, database JSON support for optimization_formats, package migration auto-discovery, and any published migrations or custom Media model overrides.
  • Check rolling-deploy behavior: new code expects new columns, so migrate before serving new code. Additive columns should be backward-compatible for old code, but confirm defaults allow old writes.
  • Confirm queue driver capacity and retry policy before enabling queued listeners. If using sync queues in production, the event may not deliver the intended request-decoupling benefit.
  • v1.6.0: Confirm minimum React/Vue versions and that the app is not on a legacy React renderer where StrictMode double-invocation behaves differently. Confirm build tooling picks up the new composable signature without a major version bump of the package's frontend entry points.

Sequencing

  • Recommended: migrate schema first, deploy code second, backfill legacy rows third, then enable status UI and queued listeners. This avoids pending badges on legacy libraries and prevents new code from querying missing columns.
  • For zero-downtime deploys, run the package migration as a pre-deploy step, then roll application instances. Schedule backfill after the deploy completes and before announcing status reporting.
  • Keep rollback simple: code rollback should leave extra columns harmless, but backfilled status values and queued listener side effects persist. Plan how to disable listeners and whether backfill needs reversal.
  • Treat v1.6.0 as its own deploy slot. It touches frontend bundles and modal behavior; do not stack it with the schema migration or the backfill window. Rollback is a straightforward asset/dependency revert, which is only true if it ships alone.

Operational Impact

Maintenance

  • The package now owns a small optimization state machine. Teams should monitor for stuck pending rows, unexpected failed rows, and mismatches between optimization_status and actual generated formats.
  • The backfill command is a one-time migration aid but may need reruns after interrupted jobs or restored media. Document ownership and safe rerun behavior.
  • Support teams need a runbook for user-visible badges: what "pending" means, when "failed" is actionable, and whether optimization_error is safe to display.
  • v1.6.0 reduces steady-state /api/media traffic but changes where latency appears. Monitoring should track first-open load time for the picker, not just aggregate request counts, or the efficiency gain will be misread as a performance regression.
  • The docs/changelog import step adds a release-time dependency on DOCS_API_TOKEN. It fails open (skipped when unset) rather than failing the release, which is the right default — but ownership for secret rotation and for noticing stale docs should be explicit.

Support

  • Status badges improve transparency but can increase tickets if legacy rows are not backfilled or if queue workers lag. Communicate the rollout before exposing status in admin or end-user UI.
  • AI alt-text listeners introduce a new support surface: queue failures, retries, vendor/API costs, and duplicate-generation complaints. Assign ownership to the consuming feature team, not the media package team.
  • v1.6.0 will generate a small wave of "media picker is slow/empty on first open" tickets if loading states are not in place before rollout. Pre-empt with a support note; the underlying behavior is correct.

Scaling

  • Each optimized image now incurs additional status writes. At high upload volume, this adds database write amplification and queue fan-out.
  • Backfilling a large media table can be the dominant scaling risk. Use chunking, off-peak scheduling, and monitoring. Avoid running it concurrently with peak uploads or heavy optimization work.
  • Queue-based listeners should be isolated or rate-limited so alt-text generation does not starve critical jobs. Budget for worker capacity and downstream API costs.
  • v1.6.0 is a scaling positive: mounted-but-closed modals cease issuing /api/media calls, and reopen without filter changes does not refetch. For apps with modals in persistent shells, this is a straightforward reduction in API and database read load, and it is the cheapest scaling win in either release.

Failure modes

  • Migration lock or timeout on a large media table.
  • Interrupted backfill leaving mixed optimized/pending legacy states.
  • Queue backlog causing valid uploads to render as pending for extended periods.
  • Listener retries generating duplicate alt text or duplicate downstream records without idempotency.
  • Optimization exception marking failed while the upload response also errors, creating ambiguous user experience.
  • Event listener throwing synchronously if accidentally registered without ShouldQueue, impacting upload latency or success.
  • Frontend type drift if OptimizationStatus/MediaOptimization are not adopted consistently.
  • v1.6.0: enabled wired to a condition that never becomes true, producing a silently empty picker.
  • v1.6.0: consumer UI lacking a first-open loading state, reading as a regression to end users.
  • v1.6.0: E2E tests or cached fixtures that assumed fetch-on-mount now asserting against empty results.
  • v1.6.0: a refresh() issued against a closed modal not taking effect until the next open, surprising consumers expecting immediate invalidation.
  • v1.6.0: docs site drifting from released code when DOCS_API_TOKEN is unset in CI, without a failing signal.

Ramp-up

  • Laravel developers should ramp quickly on the event and migration mechanics. TPM coordination is the larger effort: DBA review for the migration, infrastructure for queue workers, frontend adoption of new types, and support enablement for status badges.
  • Allocate staging time for a realistic media-table migration and a representative backfill. Validate rollback and listener-disable procedures before production rollout.
  • v1.6.0 ramp-up is light for engineers and mostly a QA/UX concern: audit each mount site for MediaModal, confirm loading affordances on first open, and re-run frontend tests. Budget half a day of frontend QA for a typical app; more if the picker is embedded in multiple shells or inside server-rendered surfaces.
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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource