Answers for "check if row empty Maatwebsite\Excel"

0

check if row empty MaatwebsiteExcel

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 MaatwebsiteExcelConcernsToCollection; It worked
for me perfect. Reference can be found on
https://github.com/Maatwebsite/Laravel-Excel/issues/1861#issuecomment-457144438
Posted by: Guest on January-10-2022

Browse Popular Code Answers by Language