Configuration
Files configuration
File manager storage and async thresholds are configured in config/files.php and config/filesystems.php. Env keys are documented under Environment variables; this page explains how disks, URLs, and cleanup interact.
Thresholds (config/files.php)
| Config key | Env | Default | Meaning |
|---|---|---|---|
duplicate_sync_max_bytes | FILES_DUPLICATE_SYNC_MAX_BYTES | 52428800 (50 MB) | Single non-folder files at or below this size are duplicated inline. Folders, bulk selections, and larger files are queued. |
zip_ttl_minutes | FILES_ZIP_TTL_MINUTES | 60 | Prepared zip archives under storage/app/zips expire after this many minutes. |
zip_max_bytes | FILES_ZIP_MAX_BYTES | 104857600 (100 MB) | Maximum zip payload size enforced by the application. |
FILES_DUPLICATE_SYNC_MAX_BYTES=52428800
FILES_ZIP_TTL_MINUTES=60
FILES_ZIP_MAX_BYTES=104857600
Queue dependency
Queued duplicates and zip builds require a running queue worker (queue:listen / queue:work). See Operations.
Filesystem disks (config/filesystems.php)
| Disk | Driver | Root / notes |
|---|---|---|
local | local | storage/app/private — default private storage (FILESYSTEM_DISK defaults to local). serve enabled for authenticated streaming patterns. |
public | local | storage/app/public — URL {APP_URL}/storage. Visibility public. |
assets | local | storage/app/public/assets — public asset files for the file manager. URL uses FILE_PUBLIC_URL_BASE (see below). |
s3 | s3 | Optional cloud disk; scaffolded with standard AWS_* env vars. |
Default disk:
FILESYSTEM_DISK=local
Symbolic link
'links' => [
public_path('storage') => storage_path('app/public'),
],
Create the link once per environment:
php artisan storage:link
Without this link, browsers cannot resolve /storage/... URLs for the public / assets disks.
FILE_PUBLIC_URL_BASE
At the top of config/filesystems.php:
$filePublicBase = rtrim((string) env('FILE_PUBLIC_URL_BASE', env('APP_URL', 'http://localhost')), '/');
The assets disk URL is:
{FILE_PUBLIC_URL_BASE}/storage/assets
| Variable | Fallback | When to set |
|---|---|---|
FILE_PUBLIC_URL_BASE | APP_URL | CDN or different public origin for asset URLs while the app still runs on another host. |
# Optional — omit to use APP_URL
FILE_PUBLIC_URL_BASE=https://cdn.example.com
APP_URL=https://app.example.com
The public disk URL still uses APP_URL directly ({APP_URL}/storage). Keep both consistent unless you intentionally split origins.
Optional S3
.env.example includes AWS scaffolding:
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
Also supported via config: AWS_URL, AWS_ENDPOINT (path-style endpoints for MinIO and similar).
To use S3 as the default filesystem disk:
- Fill AWS credentials and bucket.
- Set
FILESYSTEM_DISK=s3(or point specific code paths at thes3disk). - Confirm URL/visibility behaviour for downloads and thumbnails in your environment.
Not the default path
Local development and the documented file-manager flows assume the local/public/assets disks. Switching to S3 may require additional operational setup (CORS, private object URLs, cleanup of zips/uploads that still use local paths under storage/app).
Cleanup commands
Scheduled in routes/console.php (see Operations):
| Command | Schedule | Purpose |
|---|---|---|
files:cleanup-uploads | hourly | Removes expired partial/chunked upload sessions and their chunk storage (CleanupStaleFileUploadsCommand → FileService::cleanupStaleUploads()). |
files:cleanup-zips | hourly | Removes prepared zip downloads older than zip_ttl_minutes (CleanupExpiredFileZipsCommand → FileService::cleanupExpiredZips()). |
Run manually:
php artisan files:cleanup-uploads
php artisan files:cleanup-zips
Related HTTP surface
JSON and Inertia file-manager endpoints live under /files/* with the can.manage.files middleware. Full route table: Admin API. Data model notes: File tree model.