title: Setting aws s3 file permission to public after upload in Laravel
body: <p>I am developing a web application. In my application, I am implementing file uploaded feature. I store the uploaded file in the aws s3 bucket. I am uploading the file to the s3 bucket as follow.</p>
  
  <pre><code> $photo_file_path = $request-&gt;file('image_file')-&gt;store(
              'images/artworks/gallery-images/'.uniqid(),  's3'
            );
  </code></pre>
  
  <p>The above code is working fine. The file is uploaded to  s3. But the problem is I want the file to be public when it is uploaded to s3 so that the photo can be accessible from url as well.  I set both bucket policy and access control to public. </p>
  
  <p>This is my bucket policy</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Id": "Policy1234566788",
      "Statement": [
          {
              "Sid": "Stmt151234344545",
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:*",
              "Resource": "arn:aws:s3:::my-bucket"
          }
      ]
  }
  </code></pre>
  
  <p>As you can see my bucket is now public for both access control and bucket policy.
  <a href="https://i.stack.imgur.com/qOJcb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qOJcb.png" alt="enter image description here"></a></p>
  
  <p>But when I upload the file from Laravel, it is uploaded to the bucket, but the file is still hidden from the public. So, how can I change the file permission to public once the file is uploaded, please?</p>