📅  最后修改于: 2022-03-11 14:57:39.312000             🧑  作者: Mango
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