Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

How to find data in other row with laravel-excel

class CustomImport implements ToModel, WithHeadingRow{
  use Importable;
  public $lastRow;

  public function model(array $row){
    $this->lastRow = Data::create([
     'name' => $row['name'],
      'previousRowId' => isset($this->lastRow->id) : $this->lastRow->id ? null

    ]);
    
  }
} 
 
PREVIOUS NEXT
Tagged: #How #find #data #row
ADD COMMENT
Topic
Name
1+3 =