Skip to content

Settings Page ​

MediaFlow ships an admin page at /mediaflow/settings (route mediaflow.settings). Values saved there are stored in the mediaflow_settings table and cached, so you can change image quality, storage, delivery and appearance without a deploy.

What you can change:

  • Images: default format, quality, max width and height, auto-optimize, EXIF stripping.
  • Uploads and storage: max file size, default disk.
  • Cloud provider: preset, credentials, bucket, region, endpoint, public URL, with a Test connection button.
  • Delivery: driver, CDN base URL, signed URL lifetime.
  • Appearance: theme, light/dark mode, custom accent and folder colour, animations.
  • Access: auth on/off, guard, roles, permissions, gate (limited by config, see below).

Saved settings vs config ​

For most options, a saved value wins over config/mediaflow.php. Access control is the exception: by default, config and .env are a floor that the page cannot weaken.

  • Saving "auth disabled" never overrides MEDIAFLOW_AUTH_ENABLED=true.
  • Roles, permissions, guard and gate from config win over saved ones.

Set MEDIAFLOW_AUTH_ALLOW_UI_OVERRIDE=true if you want the page to be the single source of truth.

The cloud secret is never sent back to the browser. The page shows a masked placeholder, and saving the placeholder keeps the stored secret.

Who can open this page

The Settings page can change storage credentials. Limit MediaFlow to administrators with roles, permissions or a gate.

Settings API ​

The same page answers JSON requests, so SPAs and custom admin panels can read and write settings.

js
const token = document.querySelector('meta[name="csrf-token"]').content

// Read (secrets masked) plus the provider list
const current = await fetch('/mediaflow/settings', {
  headers: { Accept: 'application/json' },
}).then((r) => r.json())

// Update
const res = await fetch('/mediaflow/settings', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Accept: 'application/json',
    'X-CSRF-TOKEN': token,
  },
  body: JSON.stringify({
    'images.default_format': 'webp',
    'images.default_quality': 85,
    'images.max_width': 2560,
    'ui.theme': 'slate',
    'ui.mode': 'light',
  }),
})

Unknown keys are ignored. Invalid values return 422 with the reason.

Accepted keys ​

KeyAccepted values
images.default_formatwebp, jpeg, png, keep
images.default_qualityinteger 30–100
images.max_width, images.max_heightinteger 20–20000
images.auto_optimize, images.strip_exifboolean
upload.max_file_size_kbinteger, KB
storage.default_diska disk defined in config/filesystems.php
storage_quota_mbinteger, MB (informational; does not change the upload limit)
delivery.driverdisk, cdn, signed
delivery.base_urlURL
delivery.signed_url_expiration_minutesinteger 1–10080
ui.themesystem, indigo, emerald, violet, sky, amber, rose, slate, custom
ui.modesystem, light, dark
ui.custom_primary, ui.folder_colorhex colour, e.g. #2563eb
ui.inherit_system, ui.animationsboolean
auth.enabledboolean
auth.guard, auth.gatename
auth.roles, auth.permissionslist or comma-separated string
provider.namea provider preset ID or local
provider.key, provider.secret, provider.account_id, provider.bucket, provider.regionstring
provider.endpoint, provider.public_urlURL
provider.path_styleboolean

Short aliases are also accepted, for example theme, mode, folder_color, image_quality, default_image_format, auth_roles and provider_key.

Other endpoints ​

MethodEndpointPurpose
POST/mediaflow/settings/resetDelete all saved settings and fall back to config.
POST/mediaflow/settings/test-providerTest cloud credentials; see Cloud Providers.
GET/mediaflow/settings/providersMetadata for the ten provider presets.

If the cache store fails, settings are read from the database directly, so the UI keeps working.

Released under the MIT License.