Skip to content

Instantly share code, notes, and snippets.

@cursosdesarrolloweb
Created Jul 29, 2021
Embed
What would you like to do?
<?php
use App\Models\Attachment;
use Illuminate\Support\Facades\{
Route, Storage
};
Route::get("/temporary-s3-url", function () {
$attachment = Attachment::first();
$url = Storage::disk("s3")->temporaryUrl($attachment->s3_key, now()->addMinutes(5));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment