From 7a6431c77503ec4b1f2b26d2b643d7c59804f2eb Mon Sep 17 00:00:00 2001 From: Alan Reed Date: Mon, 23 Mar 2020 15:01:03 -0400 Subject: [PATCH] Add extension to filename when using withFilename() Update `handleFilename()` to append appropriate file extension when `withFilename()` is used. The extension will continue be appended when `askForFilename()` is used. --- src/Concerns/WithFilename.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Concerns/WithFilename.php b/src/Concerns/WithFilename.php index 375299b..9873389 100644 --- a/src/Concerns/WithFilename.php +++ b/src/Concerns/WithFilename.php @@ -63,7 +63,7 @@ protected function handleFilename(ActionRequest $request): void { $fields = $request->resolveFields(); - if ($filename = $fields->get('filename')) { + if ($filename = $fields->get('filename', $this->filename)) { if (!Str::contains($filename, '.')) { $filename .= '.' . $this->getDefaultExtension(); }