- 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 AppExports;
use AppUser;
use MaatwebsiteExcelConcernsFromCollection;
class UsersExport implements FromCollection
{
/**
*/
public function collection()
{
return User::all();
}
}
ExportExcelController.php
<?php
namespace AppHttpControllers;
use IlluminateHttpRequest;
use AppExportsUsersExport;
use MaatwebsiteExcelFacadesExcel;
class ExportExcelController extends Controller
{
public function export()
{
return Excel::download(new UsersExport, 'users.xlsx');
}
}
2
Answers
I was seeing the same behavior. I got around it by clearing out all caches and recreating the config cache.
I was using the package with inertia-vue and using an
<a></a>
in place of the<Link></Link>
tag worked the trick