Just set the default disk via an environment variable:
'default' => env('FILESYSTEM_DRIVER'),
In your .env file, set FILESYSTEM_DRIVER to local or s3 depending on your current environment:
FILESYSTEM_DRIVER=local
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Please, how can I use my local filesystem for development and S3 for production? My application is going to be handling large file uploads (between 100 - 150MB) but it is currently configured to use s3 as its default even in development.
I would need to upload a lot of files for testing purposes so I have decided it will be better to have different filesystem settings based on the app environment. How do I go about this?
My config/filesystem.php currently looks like this
'default' => 's3',
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'region' => env('AWS_REGION'),
'bucket' => env('AWS_BUCKET'),
],
],
Just set the default disk via an environment variable:
'default' => env('FILESYSTEM_DRIVER'),
In your .env file, set FILESYSTEM_DRIVER to local or s3 depending on your current environment:
FILESYSTEM_DRIVER=local
Please or to participate in this conversation.