ReportImport.php 422 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Imports;
  3. use App\Models\Store;
  4. use Illuminate\Support\Facades\Hash;
  5. use Maatwebsite\Excel\Concerns\ToModel;
  6. class ReportImport implements ToModel
  7. {
  8. /**
  9. * @param array $row
  10. *
  11. * @return \Illuminate\Database\Eloquent\Model|null
  12. */
  13. public function model(array $row)
  14. {
  15. return new Store([
  16. 'name'=>$row[0],
  17. 'man_id'=>$row[2],
  18. ]);
  19. }
  20. }