4 months ago

how to use Storage::download()

Posted 4 months ago by michalis

this is my method

    public function download($id)
        $file = File::find($id);
        $link = json_decode($file->link);

        return Storage::download('storage/' . $link[0]->download_link);

but it wont download the file, I get a file not found exeption

League \ Flysystem \ FileNotFoundException
File not found at path: storage/files/May2019/caAsV09m4I5FZdOmALIZ.png

the path i correct though, not sure why its not working

when I do it as a link on the front end it works, but doing it from a method in the backend does not work for some reason

am I using the function correctly?

Please sign in or create an account to participate in this conversation.