diff --git a/src/Http/Controllers/SignedStorageUrlController.php b/src/Http/Controllers/SignedStorageUrlController.php index d2ddb43..e236621 100644 --- a/src/Http/Controllers/SignedStorageUrlController.php +++ b/src/Http/Controllers/SignedStorageUrlController.php @@ -34,7 +34,7 @@ public function store(Request $request) $expiresAfter = config('vapor.signed_storage_url_expires_after', 5); $signedRequest = $client->createPresignedRequest( - $this->createCommand($request, $client, $bucket, $key = ('tmp/'.$uuid)), + $this->createCommand($request, $client, $bucket, $key = $this->getKey($uuid)), sprintf('+%s minutes', $expiresAfter) ); @@ -141,6 +141,17 @@ protected function storageClient() return new S3Client($config); } + /** + * Get key for the given UUID. + * + * @param string $uuid + * @return string + */ + protected function getKey(string $uuid) + { + return 'tmp/'.$uuid; + } + /** * Get the default visibility for uploads. *