Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lonare's avatar

Laravel 9 + Nova v4 + AWS S3 integration issue

I have followed this guide (https://laravel.com/docs/9.x/filesystem#amazon-s3-compatible-filesystems) and did the following.

I have tried several ways to integrate AWS s3, but it's not working:

  1. I have created an open to public S3 instance.
  2. Added the CORS settings to it so that it could be accessed from my localhost machine : http://127.0.0.1:8000/
[
    {
        "AllowedHeaders": [
            ""
        ],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "http://127.0.0.1:8000/"
        ],
        "ExposeHeaders": [
            "x-amz-server-side-encryption",
            "x-amz-request-id",
            "x-amz-id-2"
        ],
        "MaxAgeSeconds": 3000
    }
]
  1. Updated Block public access and deselected all Added bucket policy to :
{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "AllowPublicRead",
            "Effect": "Allow",
            "Principal": {
                "AWS": ""
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::NAME_OF_MY_BUCKET/*"
        }
    ]
}
  1. Updated filesystem config:
's3' => [
            '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('AWS_ENDPOINT'),
            'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
            'throw' => false,
            'visibility' => 'public'
        ],
  1. Installed "league/flysystem-aws-s3-v3": "^3.3" via composer.
  2. But when I add the field into one of my modal
Image::make('Media', 'image')
                ->disk('s3'),

It never uploads anything on my AWS bucket neither it displays any images

0 likes
0 replies

Please or to participate in this conversation.