Post and Gallery models, migrations, create/edit persistence, custom filenames and optional conversion rows, see A complete Post gallery.
To reuse saved images in a website gallery or API, see Gallery images in your website and API. It includes authorized routes, original-image fallbacks, a Blade view and the Spatie alternative without an extra conversion table.
Choose a field
Imports:
One document
withRecommendedDefaults() configures a 5 MiB per-file limit, create-form path authorization, removal/replacement cleanup, open/download actions and focus outline. For FlexFileUpload it selects document formats; for FlexImageUpload it selects images. Override individual settings afterward.
Image gallery
File list
Grid sizes and action menu
md or 96px sm tiles. Secondary actions can stay below, animate inside on hover/focus, or appear in the ellipsis menu. Menu items follow enabled features; preview can open by clicking an image. All grid and viewer options.
Compact list
compactList() is also available for the compact list presentation.
Avatar
avatar() takes precedence over an explicitly configured file layout.
Image editor
Enable editing for avatar, grid or list images withimageEditor(). The edit action
appears only for supported images that are ready to edit. It is hidden during
loading, transfer, pause, failure and removal, and when the field is disabled.
circleCropper() for a circular avatar crop. Other images support free cropping,
configured aspect ratios, quarter-turn rotation and horizontal/vertical flipping.
The editor includes brightness, warmth, contrast, exposure, highlights, shadows,
fade, saturation, vibrance, clarity, sharpness and vignette. Reset restores the
original crop and adjustments. Save shows a busy indicator while exporting.
A stored image opens from its original file, even when its attachment preview uses
a small conversion. Interactive adjustments use a smaller preview for responsiveness;
Save renders the original resolution before applying your crop and output resizing.
On touch screens, use the crop handles, drag the image, pinch to zoom and move the
adjustment slider. Keyboard input also works on the slider.
With instantUpload(false), the edited image waits for your upload action. The
previous server association remains until that new transfer succeeds. With automatic
transfer, it starts immediately. Configured file metadata follows the replacement.
Media OS creates the configured conversions from the edited bytes when the form
saves; queued conversions show the original until the worker finishes. Spatie
uses the conversions registered on your model and the same configured queue.
Raster editing exports a still frame for animated images. It does not preserve all
EXIF metadata. Cross-origin storage must allow the browser to fetch the authorized
original through its CORS policy. Editor pixel and memory limits follow your Media
OS image limits; extremely large images can be rejected before adjustment/export.
Automatic or manual transfer
instantUpload(false), files wait for Upload or the enclosing form submission. Pending files are transferred before that form continues. Without an enclosing form, use Upload explicitly. URL import and camera confirmation process their files immediately.
Transfer completion means the file reached temporary storage. Permanent storage and record acceptance occur in the save lifecycle. Thumbnail jobs may finish afterward.
Parallel transfers
maxFiles() and worker-job concurrency.
Pause and resume
Drag to reorder
Presentation options
primary, secondary, flat. The built-in description displays declared formats and limits. Use emptyStateHint() for rules that cannot be inferred, such as organization-specific content requirements.
Custom tile size:
Model state
A single disk field stores a relative path or null. A multiple disk field stores an ordered array of paths; use an array cast for the model attribute:Continue configuring
- Validation, disks, filenames and cleanup
- Image conversions, avatars, URL and camera
- Optional information editor and translations
- PHP events, save hooks and recovery
- Complete field configuration reference
- Media OS storage service
Continue configuring your field
Storage and validation
Choose accepted formats, limits, naming, disks and cleanup.
Images and sources
Configure conversions, default avatars, URL import and capture.
Metadata editor
Choose exactly which fields and languages your users can edit.
Events and recovery
React to storage, acceptance, errors and interrupted operations.
Camera controls and upload feedback
With->allowWebcamUpload(), the camera opens in a dedicated view with a shutter,
mirror mode and a composition grid. Available devices can switch cameras; torch
appears only when the selected camera supports it. Review the photo before using
it, or retake it. Closing the camera, hiding the page or reviewing a capture stops
the live stream. Device permission is requested only when opening the camera.
The capture frame is 4:5 on phones and 16:9 on desktop. The saved photo uses the
same centered crop as the preview, retaining pixel density within your configured
Media OS limits. The sensor’s native photo is used when supported; otherwise the
current video frame is captured. Mirror mode applies to the saved photo too.
Controls appear only when the selected camera and browser expose support:
- Zoom presets, a zoom slider and two-finger zoom.
- Torch for continuous illumination, separately from photo flash modes.
- Exposure modes, compensation, exposure time and ISO.
- White balance modes and color temperature.
- Focus modes and focus distance.
- Hardware brightness, contrast, saturation, sharpness, frame rate, pan/tilt and background blur where available.
- Native photo resolution, flash and red-eye reduction where supported.
->uploadingMessage('Uploading photos…'). Manual queues upload through the shared
submission barrier; paused files must be resumed first. Background conversions are
separate from transfer and do not hold the submit button after files are uploaded.
A custom HTML button needs its own loading presentation.
The editor keeps original pixel dimensions unless cropping or a configured resize
changes them. Interactive adjustment uses a small preview; full-resolution output
is generated on Save. JPEG/WebP use maximum browser encoder quality and are still
reencoded. PNG encoding preserves raster pixels; canvas editing does not preserve
every EXIF or color-profile attribute. Large images remain subject to configured
Media OS pixel and working-memory limits.
Compact picker header and file clicks
UsecompactHeader() with either uploadLayout('list') or uploadLayout('grid') to hide the large file artwork while keeping requirements and Select files. maxFiles() also disables adding once a multiple field reaches its active slot limit. fileClickAction() runs a trusted PHP callback when a completed file is clicked; fileClickUrl() resolves a custom destination. See configuration and complete examples.