I'm uploading a private file using s3 driver and showing the file with expiration.
It works fine if there's an uploaded file but if the avatar is null it gives an error
here's what's inside my Resource
'avatar' => Storage::temporaryUrl(
$this->avatar,
now()->addMinutes(5)
),
and the error i get
"message": "Found 1 error while validating the input provided for the GetObject operation:\n[Key] expected string length to be >= 1, but found string length of 0",
"exception": "InvalidArgumentException",
"file": "D:\xampp\htdocs\DCTS\paradigm\vendor\aws\aws-sdk-php\src\Api\Validator.php",
"line": 65,
Is there a way i can still pull my resource and show the avatar NULL if no file is uploaded?