Media storage & variants
Image variants, storage disks, S3, and CDN URLs.
This page expands on config/media.php and the Media environment variables described on the Configuration page.
Image variants
For raster images (not SVG or GIF), NebulaCMS can generate responsive presets after upload:
| Preset | Typical max width |
|---|---|
thumb |
300 px |
medium |
768 px |
large |
1920 px |
Generation uses Intervention Image. Variant metadata is stored on the media record; URLs are exposed in the admin API (e.g. variant_urls).
- Disable variants globally with
MEDIA_IMAGE_VARIANTS=false, or adjust sizes and quality inconfig/media.php. MEDIA_VARIANT_JPEG_QUALITYcontrols JPEG output quality (default 82).
Storage disks
Set MEDIA_DISK in .env:
| Value | Behavior |
|---|---|
public (default) |
Files under storage/app/public; serve via the public/storage symlink (php artisan storage:link). |
s3 |
Configure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION, AWS_BUCKET, and ensure IAM allows required object operations. |
See Laravel’s filesystem documentation for disk configuration details.
CDN and public URLs
- Local
publicdisk: setMEDIA_URLto your asset base (for examplehttps://cdn.example.com/storage) soStorage::url()and generated media URLs point at your CDN or reverse proxy. - S3: set
AWS_URLto your public base URL (for example a CloudFront distribution) so object URLs resolve correctly.
For a full list of MEDIA_* variables, see the Media subsection under Environment variables.
See also
- Configuration
- Content model — how media attaches to posts
- Operations — backups,
storage/, production notes