0

I have a zip folder under storage and I want to download this folder whenever I click a button. But my code does not work. What is the problem?

here's my livewire component

<div class="my-auto">
        <a type=button wire:click="downloadKit" style="border-radius:4px" class="">{{ __('Download') }}</a>
    </div>
public function downloadKit(){
        $file = Storage::disk('public')->get('kit.zip');
    
        return (new Response($file, 200));
    }
wertyu
  • 93
  • 1
  • 3
  • 17

1 Answers1

0

You can return a file response like this return Storage::download("/path/to/kit.zip", "kit.zip");

The path will be relative to /storage/app

justrusty
  • 827
  • 7
  • 10