laravel s3 get url path code example
Example 1: laravel storage get file path
use Illuminate\Support\Facades\Storage;
$path = Storage::path('file.jpg');
Example 2: laravel download file from s3
$attachment = TicketAttachment::find($id);
$headers = [
'Content-Type' => 'application/jpeg',
'Content-Disposition' => 'attachment; filename="'. $attachment->name .'"',
];
return \Response::make(Storage::disk('s3')->get($attachment->url), 200, $headers);