简体   繁体   中英

laravel : Error Call to a member function all() on array

This is used to export excel

My controllers:

public function reportExport(Request $request)
{
    return Excel::download(new ReportExport($request), 'LAPORAN ABSENSI.xlsx');
}

Export folder: ReportExport

return [
    "att_cross" => $att_cross,
    "belum_absen" => $belum_absen,
    "absen" => $absen,
];

but, when I return one of the data is successful, for example:

return $absen;

I want to display the contents of the variable $absent, $belum_absen, $att_cross but I get an error message "Call to a member function all() on array " how can I display the data for these three parameters?

Read the docs for Excel package, you need to map() the output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM