mikebarwick's avatar

Storage::disk('s3')...get 'region' in controller

So, I'm uploading images to S3 using Flysystem. Works as it should. However, I'm writing a function to compile the URL of the file uploaded (i.e. S3 url of file, etc.).

That said, the question doesn't really pertain to that, instead, how can I retrieve the region and even the bucket variables found in config/filesystem.php so I can use them within my view?

0 likes
2 replies
TerrePorter's avatar
Level 12

Try,

\Config::get('filesystems.disks.s3')

returns

array:5 [
  "driver" => "s3"
  "key" => "your-key"
  "secret" => "your-secret"
  "region" => "your-region"
  "bucket" => "your-bucket"
]
1 like
mikebarwick's avatar

Awesome. I was trying the Config:: method, but my get was wrong. Thanks dude. Exactly what I needed.

Please or to participate in this conversation.