composer 下载
composer require maatwebsite/excel
引入
use Elasticsearch\ClientBuilder;
创建excel文件
php artisan make:Exports FangExports
FangExports 里面
return Fang::all();
php后台
//导出房东excel
public function exports()
{
return Excel::download(new FangOwnersExport(),'房东列表.xlsx');
}