From d0799116e301de15de41c5edc67561f2c72dc30c Mon Sep 17 00:00:00 2001 From: Ash Allen Date: Fri, 31 Dec 2021 12:45:31 +0000 Subject: [PATCH] Added buildTemporaryUrlsUsing() docs. (#7542) * Added buildTemporaryUrlsUsing() docs. * Update filesystem.md * Update filesystem.md Co-authored-by: Taylor Otwell --- filesystem.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/filesystem.md b/filesystem.md index a5b621a6fd..2b1c1bdde4 100644 --- a/filesystem.md +++ b/filesystem.md @@ -243,6 +243,35 @@ If you need to specify additional [S3 request parameters](https://docs.aws.amazo ] ); +If you need to customize how temporary URLs are created for a specific storage disk, you can use the `buildTemporaryUrlsUsing` method. For example, this can be useful if you have a controller that allows you to download files stored via a disk that doesn't typically support temporary URLs. Usually, this method should be called from the `boot` method of a service provider: + + buildTemporaryUrlsUsing(function ($path, $expiration, $options) { + return URL::temporarySignedRoute( + 'files.download', + $expiration, + array_merge($options, ['path' => $path]) + ); + }); + } + } + #### URL Host Customization