Skip to content

Environment Variables ​

All options live in config/mediaflow.php. Most can be set from .env; the table lists each variable, its default and the config key it maps to. After changing .env in production, run php artisan config:cache.

Routes ​

VariableDefaultConfig keyPurpose
MEDIAFLOW_ROUTE_PREFIXmediaflowroute_prefixURL prefix for every MediaFlow page and endpoint.
MEDIAFLOW_MIDDLEWAREwebmiddlewareComma-separated base middleware. The access-control middleware is always added after it.

Access control ​

VariableDefaultConfig keyPurpose
MEDIAFLOW_AUTH_ENABLEDtrueauth.enabledRequire a signed-in user on management routes.
MEDIAFLOW_GUARDdefault guardauth.guardGuard to authenticate with. MEDIAFLOW_AUTH_GUARD is accepted as an alias.
MEDIAFLOW_ROLESnoneauth.rolesComma-separated roles; any one grants access.
MEDIAFLOW_PERMISSIONSnoneauth.permissionsComma-separated permissions; any one grants access.
MEDIAFLOW_GATEnoneauth.gateGate ability that must allow the user.
MEDIAFLOW_CUSTOM_MIDDLEWAREnoneauth.custom_middlewareExtra middleware appended to every route, e.g. verified,throttle:60,1.
MEDIAFLOW_AUTH_ALLOW_UI_OVERRIDEfalseauth.allow_ui_overrideLet the Settings page relax or replace the rules above.
MEDIAFLOW_USER_SCOPEDfalsescope.user_scopedGive every user a private library.

Details: Access Control and Per-User Scoping.

Database tables ​

VariableDefaultConfig key
MEDIAFLOW_TABLE_PREFIXmediaflow_table_prefix
MEDIAFLOW_TABLE_MEDIA{prefix}mediatables.media
MEDIAFLOW_TABLE_FOLDERS{prefix}folderstables.folders
MEDIAFLOW_TABLE_VARIANTS{prefix}variantstables.variants
MEDIAFLOW_TABLE_UPLOAD_SESSIONS{prefix}upload_sessionstables.upload_sessions
MEDIAFLOW_TABLE_SETTINGS{prefix}settingstables.settings

Set these before running the migrations. See Database Tables.

Storage ​

VariableDefaultConfig keyPurpose
MEDIAFLOW_DISKpublicdefault_diskDisk for public uploads. Set automatically to mediaflow_cloud when a cloud provider is active.
MEDIAFLOW_PRIVATE_DISKdefault_diskprivate_diskDisk for uploads with visibility=private. Use a non-public disk such as local.
MEDIAFLOW_TEMP_DISKlocaltemporary_diskDisk for temporary upload files.

Cloud provider ​

VariableDefaultConfig keyPurpose
MEDIAFLOW_PROVIDERlocalprovider.namePreset ID: cloudflare_r2, aws, contabo, digitalocean, wasabi, backblaze, gcs, azure, cloudinary, minio, or local for none.
MEDIAFLOW_PROVIDER_KEYnoneprovider.keyAccess key ID.
MEDIAFLOW_PROVIDER_SECRETnoneprovider.secretSecret access key.
MEDIAFLOW_PROVIDER_BUCKETnoneprovider.bucketBucket or container name.
MEDIAFLOW_PROVIDER_ACCOUNT_IDnoneprovider.account_idCloudflare account ID for R2. Falls back to CLOUDFLARE_ACCOUNT_ID, then CLOUDFLARE_R2_ACCOUNT_ID.
MEDIAFLOW_PROVIDER_REGIONpreset defaultprovider.regionRegion, e.g. us-east-1, nyc3, eu2.
MEDIAFLOW_PROVIDER_ENDPOINTpreset templateprovider.endpointFull S3 endpoint URL, when the preset cannot work it out.
MEDIAFLOW_PROVIDER_PUBLIC_URLnoneprovider.public_urlPublic or CDN base URL. When set, delivery switches to the cdn driver.
MEDIAFLOW_PROVIDER_PATH_STYLEpreset defaultprovider.path_styleForce path-style bucket addressing.

See Cloud Providers.

Upload limits ​

VariableDefaultConfig keyPurpose
MEDIAFLOW_MAX_FILE_SIZE_KB20480 (20 MB)max_file_size_kbLargest accepted file. The Settings page can override it.
MEDIAFLOW_MAX_IMAGE_MEGAPIXELS50max_image_megapixelsRejects larger images to protect GD from decompression bombs.

allowed_mimes, blocked_extensions and sanitize_svg are set in the config file only. See Upload Rules.

Images ​

VariableDefaultConfig keyPurpose
MEDIAFLOW_IMAGE_DRIVERgdimages.driverOnly gd ships today.
MEDIAFLOW_DEFAULT_FORMATwebpimages.default_formatFormat uploads are converted to: webp, jpeg, png or keep.
MEDIAFLOW_DEFAULT_QUALITY82images.default_qualityEncoding quality, 30 to 100.
MEDIAFLOW_AUTO_OPTIMIZEtrueimages.auto_optimizeConvert and downscale images on upload.
MEDIAFLOW_MAX_WIDTH2560images.max_widthLarger images are scaled down on upload.
MEDIAFLOW_MAX_HEIGHT2560images.max_heightLarger images are scaled down on upload.
MEDIAFLOW_QUEUE_PROCESSINGfalseimages.queue_processingReserved; processing is synchronous today.
MEDIAFLOW_QUEUEdefaultimages.queue_nameReserved for queued processing.

strip_exif, generate_thumbnails and presets are set in the config file. See Image Processing.

Delivery ​

VariableDefaultConfig keyPurpose
MEDIAFLOW_DELIVERY_DRIVERdiskdelivery.driverdisk (the disk's URL), cdn (prefix with the CDN URL) or signed (always expiring URLs).
MEDIAFLOW_CDN_URLnonedelivery.base_urlBase URL for the cdn driver.
MEDIAFLOW_SIGNED_EXPIRY30delivery.signed_url_expiration_minutesLifetime of signed URLs, in minutes.

See Delivery URLs.

Interface ​

VariableDefaultConfig keyPurpose
MEDIAFLOW_SHOW_HEADERtrueui.show_headerShow the header bar on the built-in pages.
MEDIAFLOW_DEV_NAVfalseui.show_dev_navShow links to the docs and pipeline pages in the header.

Other ui keys in the config file: animations, show_pipeline (default for the components' pipeline option) and items_per_page (24). enabled, allow_delete, allow_rename and allow_move are reserved and not enforced yet.

Complete example ​

dotenv
# Routes and access
MEDIAFLOW_ROUTE_PREFIX=admin/media
MEDIAFLOW_AUTH_ENABLED=true
MEDIAFLOW_ROLES=admin,editor
MEDIAFLOW_CUSTOM_MIDDLEWARE=throttle:60,1

# Storage
MEDIAFLOW_DISK=public
MEDIAFLOW_PRIVATE_DISK=local

# Cloudflare R2 behind a custom domain
MEDIAFLOW_PROVIDER=cloudflare_r2
MEDIAFLOW_PROVIDER_ACCOUNT_ID=your-32-character-account-id
MEDIAFLOW_PROVIDER_KEY=your-access-key-id
MEDIAFLOW_PROVIDER_SECRET=your-secret-access-key
MEDIAFLOW_PROVIDER_BUCKET=my-bucket
MEDIAFLOW_PROVIDER_PUBLIC_URL=https://cdn.example.com

# Images
MEDIAFLOW_DEFAULT_FORMAT=webp
MEDIAFLOW_DEFAULT_QUALITY=82
MEDIAFLOW_MAX_FILE_SIZE_KB=20480

Released under the MIT License.