Is this the admin's media library?
No. There is no shared pool, no folders and no cross-entity browsing — the field lists one record's collection and nothing else. For files reused between entities, use the media library that ships with tbtop/admin.
ModuleAvailableMIT
One form field that lists a record's media collection, uploads into it and imports images by URL. It is a field, not a second media library: files belong to the record they are attached to.
The model declares a media collection the way spatie documents it; the field binds to that record and collection and handles the rest.
forCollection($record, $collection) is the whole setup — upload endpoints are derived from the page path on the client, so there is nothing to register. Without multiple() the field holds one media id; with it, a list.
The same field covers a cover image and a gallery.
Files upload from the browser, or are pulled from a URL. Imports run synchronously and re-encode to WebP by default, with the format and quality configurable.
Moving an existing image in does not mean downloading it first.
The record and collection are read off the field on the re-resolved page, never from the request, and the page's own gate applies. URL import blocks private ranges and non-http schemes with DNS pinning, refuses redirects, stops past the size ceiling and verifies the mime from the downloaded bytes.
A caller cannot redirect an upload into another model.
The package is a form field with a deliberately small surface. These are the limits as the code stands, not a roadmap.
No. There is no shared pool, no folders and no cross-entity browsing — the field lists one record's collection and nothing else. For files reused between entities, use the media library that ships with tbtop/admin.
Not today. The field has no drag-sorting, no cropping and no alt-text editing. It attaches images to a collection and lists what is attached.
The field changes which media the record points at. It does not delete files from storage — clearing up the disk stays with spatie's own tooling and your retention policy.
PHP 8.4, Laravel 11–13, tbtop/admin and spatie/laravel-medialibrary ^11. It is two halves in one repository — the PHP field and its React client — and both are required, published from the same tag so they cannot drift apart. The record must already be persisted: spatie derives the storage path from the model key, so attaching to an unsaved model is refused.
Both halves install from the same tag. Register the client field once where your admin entrypoint registers the others, declare the collection on the model, and the field is ready. New to tbtop/admin? The field requires it — install it first with composer require tbtop/admin.