Skip to content

Instantly share code, notes, and snippets.

@shanerbaner82
Last active August 23, 2023 18:18
Show Gist options
  • Save shanerbaner82/ee50f33218e6e922b8832a75e26b9958 to your computer and use it in GitHub Desktop.
Save shanerbaner82/ee50f33218e6e922b8832a75e26b9958 to your computer and use it in GitHub Desktop.
## Bucket Policy
```
{
"Version": "2012-10-17",
"Id": "Policy1692807538499",
"Statement": [
{
"Sid": "Stmt1692807537432",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::laravelonlinebucket"
}
]
}
```
## Bucket CORS
```
[
{
"AllowedHeaders": [],
"AllowedMethods": [
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"*"
]
}
]
```
## `.env` Variables
```
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_URL="https://{BUCKET_NAME}}.s3.amazonaws.com/"
AWS_USE_PATH_STYLE_ENDPOINT=true
```
## Custom Filesystem Disk
```
'profile-photos' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('PROFILE_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'visibility' => 'public',
'root' => 'profile-photos'
],
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment