簡體   English   中英

laravel:錯誤調用數組上的成員 function all()

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

這個用來導出 excel

我的控制器:

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

導出文件夾:ReportExport

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

但是,當我成功返回其中一個數據時,例如:

return $absen;

我想顯示變量 $absent、$belum_absen、$att_cross 的內容,但我收到一條錯誤消息“Call to a member function all() on array” 我該如何顯示這三個參數的數據?

閱讀 Excel package 的文檔,您需要map() output。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM