Skip to content

Instantly share code, notes, and snippets.

@timetorock
Created February 3, 2021 22:15
Show Gist options
  • Save timetorock/6054fd9e6e35d9239720e579eff0e682 to your computer and use it in GitHub Desktop.
Save timetorock/6054fd9e6e35d9239720e579eff0e682 to your computer and use it in GitHub Desktop.
Laravel 6.x, 7.x, 8.x, DigitalOcean Spaces S3 Config
If you want to setup DigitalOcean spaces in Laravel, use next config:
(also this config will help you if AWS PHP SDK make HTTP requests instead of HTTPS)
'do_spaces' => [
'driver' => 's3',
'key' => env('DO_SPACES_ACCESS_KEY_ID'),
'secret' => env('DO_SPACES_SECRET_ACCESS_KEY'),
'endpoint' => 'https://' . env('DO_SPACES_BUCKET') . '.' . env('DO_SPACES_ENDPOINT'),
'region' => env('DO_SPACES_REGION'),
'bucket' => env('DO_SPACES_BUCKET'),
'bucket_endpoint' => true, //VERY IMPORTANT OPTION
'visibility' => 'public',
'url' => 'https://' . env('DO_SPACES_BUCKET') . '.' . env('DO_SPACES_ENDPOINT') . '/',
],
DO_SPACES_ACCESS_KEY_ID=
DO_SPACES_SECRET_ACCESS_KEY=
DO_SPACES_ENDPOINT=fra1.digitaloceanspaces.com
DO_SPACES_REGION=fra1
DO_SPACES_BUCKET=bucketname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment