📌  相关文章
📜  检查行是否为空 Maatwebsite\Excel - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:39.312000             🧑  作者: Mango

代码示例1
Try using ToCollection and then try if($row->filter()->isNotEmpty())

public function collection(Collection $rows)
   {
      foreach($rows as $row) {
        if($row->filter()->isNotEmpty()){
            // you logic can go here
           }
        }   
   }
Don't forget to include use Maatwebsite\Excel\Concerns\ToCollection; It worked
for me perfect. Reference can be found on
https://github.com/Maatwebsite/Laravel-Excel/issues/1861#issuecomment-457144438