1

In Laravel filesystems you have the standard s3 details like below:

's3' => [
    'driver' => 's3',
    'key' => env('AWS_ACCESS_KEY_ID', 'your-key'),
    'secret' => env('AWS_SECRET_ACCESS_KEY', 'your-secret'),
    'region' => env('AWS_DEFAULT_REGION', 'your-region'),
    'bucket' => env('AWS_BUCKET', 'your-bucket'),
    'url' => env('AWS_URL'),
    'endpoint' => env('AWS_ENDPOINT'),
],

What I am trying to establish is having 2 disks listed in my filesystems, one that points at a directory on my bucket that is public and another disk that points somewhere private.

I'm looking for something like:

root_path => '/public'
Lewis Smith
  • 1,271
  • 1
  • 14
  • 39

1 Answers1

5

use can use something like this

    's3-public' => [
        'driver' => 's3',
        'key' => env('AWS_ACCESS_KEY_ID', 'your-key'),
        'secret' => env('AWS_SECRET_ACCESS_KEY', 'your-secret'),
        'region' => env('AWS_DEFAULT_REGION', 'your-region'),
        'bucket' => env('AWS_BUCKET', 'your-bucket'),
        'url' => env('AWS_URL'),
        'endpoint' => env('AWS_ENDPOINT'),
        'root' => 'test/public'
    ],


    's3-private' => [
        'driver' => 's3',
        'key' => env('AWS_ACCESS_KEY_ID', 'your-key'),
        'secret' => env('AWS_SECRET_ACCESS_KEY', 'your-secret'),
        'region' => env('AWS_DEFAULT_REGION', 'your-region'),
        'bucket' => env('AWS_BUCKET', 'your-bucket'),
        'url' => env('AWS_URL'),
        'endpoint' => env('AWS_ENDPOINT'),
        'root' => 'test/private'
    ],

you can use same bucket for this two disks but files save to different folder

Amir Najdi
  • 92
  • 4