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

aligajani's avatar

How can I instruct Nova to store the fullUrl of the S3 uploads?

  1. This doesn't work because the attachment isn't a valid key.
  2. This is repetitive and I am sure there can be a global way.
->disk('s3')
                ->storeAs(function (Request $request) {
                    $name = sha1($request->attachment->getClientOriginalName()) . '-'
                        . now()->format('D_Y-m-d-T_H-m-s') . '-'
                        . ($request->attachment->getClientOriginalName());
                    $awsBucket = env("AWS_BUCKET");
                    $awsRegion = env("AWS_DEFAULT_REGION");

                    return "https://{$awsBucket}.s3.{$awsRegion}.amazonaws.com/{$name}";
                }),
0 likes
1 reply
bobbybouwmann's avatar

The only way I know to work around this is creating your own custom field that extends the File field and then you can override the storeAs method. Or add your own storeAsS3 method, as an example.

Please or to participate in this conversation.