NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages

The flat add* methods on the MediaLibrary facade store media with no owning model — brand logos, shared PDFs, app-wide assets:

use RoundlyConsulting\MediaLibrary\Facades\MediaLibrary;

$logo = MediaLibrary::add(storage_path('brand/logo.svg'))
    ->usingName('Primary logo')
    ->toBucket('brand');

MediaLibrary::bucket('brand')->get();            // Builder<Media> over a global bucket (unbound drafts excluded)
MediaLibrary::find($logo->uuid);                 // any media by uuid
MediaLibrary::clearBucket('brand');              // delete the global bucket; returns the count

Global media gets the same storage, URLs and dedup as model media. Unbound drafts are not global media, so bucket() and clearBucket() leave them alone. It has no owning bucket definition, so it has no variants. Move media between a model and a global bucket with MediaLibrary::move($media, to: null, bucket: 'brand').

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.