simioluwatomi
1 year ago
1078
3
Laravel

How to use local filesystem for development but S3 for production

Posted 1 year ago by simioluwatomi

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'),
        ],

    ],
    

Please sign in or create an account to participate in this conversation.