Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Prabodhana's avatar

Export process work but no file downloaded [ Maatwebsite / Laravel-Excel ]

  • PHP version: 7.3.9
  • Laravel version: 5.8.30
  • Package version: 3.1

Description

I am trying to export excel file. I do all things in the documentation and the process work with no errors. but the excel file does not download.. I'm using Ubuntu OS.

UserExport.php

<?php

 namespace App\Exports;

 use App\User;
 use Maatwebsite\Excel\Concerns\FromCollection;

 class UsersExport implements FromCollection
 {
    /**
     */
     public function collection()
     {
         return User::all();
      }
  } 

ExportExcelController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Exports\UsersExport;

use Maatwebsite\Excel\Facades\Excel;

class ExportExcelController extends Controller
{
    public function export() 
    {
        
        return Excel::download(new UsersExport, 'users.xlsx');
    }
}

0 likes
1 reply
Nakov's avatar

@prabodhana

So the export process does not work if there is no file :) Have you tried different browser?

Please or to participate in this conversation.