Skip to content

Commit

Permalink
Add extension to filename when using withFilename()
Browse files Browse the repository at this point in the history
Update `handleFilename()` to append appropriate file extension when `withFilename()` is used. The extension will continue be appended when `askForFilename()` is used.
  • Loading branch information
aarreedd authored Mar 23, 2020
1 parent d3c17f7 commit 7a6431c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Concerns/WithFilename.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 7a6431c

Please sign in to comment.