Skip to content

Commit

Permalink
Fixed Issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-webkul committed Jan 6, 2025
1 parent fee658f commit 37a0bf7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest): JsonRespons
/**
* Download image or file
*/
public function download(): StreamedResponse
public function download()
{
if (! request('path')) {
return false;
}

return Storage::download(request('path'));
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<x-admin::form.control-group.controls.inline.file
::name="'{{ $attribute->code }}'"
::value="'{{ route('admin.settings.attributes.download', ['path' => $value]) }}'"
::value="'{{ $value ? route('admin.settings.attributes.download', ['path' => $value]) : '' }}'"
rules="required|mimes:jpeg,jpg,png,gif"
position="left"
:label="$attribute->name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ class="flex h-[34px] items-center justify-between rounded border border-transpar
<a
:href="inputValue"
v-if="inputValue"
target="_blank"
>
<span class="icon-download pl-[2px] text-2xl font-normal"></span>
</a>
<span
v-else
class="icon-download cursor-pointer pl-[2px] text-2xl font-normal"
>
</span>
<template v-if="allowEdit">
<i
@click="toggle"
Expand Down

0 comments on commit 37a0bf7

Please sign in to comment.