Download files from storage in Laravel

Download files from storage in Laravel

A filesystem is often an underrated but very important factor in web development. Downloading files from storage in laravel application is even easier with the implementation of response or download method. This feature was added by reinink and merged by taylor in laravel 5.5.

“The download method accepts a file name as the second argument to the method, which will determine the file name that is seen by the user downloading the file. Finally, you may pass an array of HTTP headers as the third argument to the method” as described in the documents.

Example: