Skip to content

Instantly share code, notes, and snippets.

@mkdesignn
Created June 18, 2019 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkdesignn/7491ed03d86937b6c2667f72b10c7a73 to your computer and use it in GitHub Desktop.
Save mkdesignn/7491ed03d86937b6c2667f72b10c7a73 to your computer and use it in GitHub Desktop.
$s3 = \Storage::disk('s3');
$client = $s3->getDriver()->getAdapter()->getClient();
$expiry = "+10 minutes";
$command = $client->getCommand('GetObject', [
'Bucket' => \Config::get('filesystems.disks.s3.bucket'),
'Key' => "file/in/s3/bucket"
]);
$request = $client->createPresignedRequest($command, $expiry);
return (string) $request->getUri();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment