using laravel I tried to create excel and add data on it and download(export) it as excel file on client side but instead of excel file to be downloaded it return string. can someone help me please. thanks in advance.
My controller code
use Maatwebsite\Excel\Facades\Excel;
public function exportreport(Request $request){
$file = "users.xlsx";
return Excel::download(new reportExport, $file);
}
my export code
use App\cqqeuryformModel;
class reportExport implements FromCollection
{
public function collection(){
return cqqeuryformModel::all();
}
}
return is string instead of excel file ajax return
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire