File Downloading in Laravel 5.3

Downloading files are very easy in laravel. In PHP you need to set proper headers but in laravel all these headers are comes single line of response object. Just use response object along with file path.

step 1 : Create ‘downloads’ table

step 2 : Insert sample data into ‘downloads’ table

step 3 : Copy and paste sample files i.e., ‘test-excel.xls’ and ‘test-pdf.pdf’ files in ‘public/downloads’ folder

step 4 : Routing (app/Http/Routes.php)

step 5 : Controller (app/Http/Controllers/DownloadController.php)

step 6 : View 


Sample screen short for file downloading :

file-downloading-in-laravel 5.3



  • Ricki

    gak berhasil

  • medoune cisse

    Please Can you added a counter to your apps ….