You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
649 B
28 lines
649 B
1 year ago
|
<?php
|
||
|
|
||
|
namespace App\Imports;
|
||
|
|
||
|
use App\Models\Customer;
|
||
|
use Illuminate\Support\Facades\Hash;
|
||
|
use Maatwebsite\Excel\Concerns\ToModel;
|
||
|
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||
|
|
||
|
class CustomerImport implements ToModel, WithHeadingRow
|
||
|
{
|
||
|
/**
|
||
|
* @param array $row
|
||
|
*
|
||
|
* @return \Illuminate\Database\Eloquent\Model|null
|
||
|
*/
|
||
|
public function model(array $row)
|
||
|
{
|
||
|
return new Customer([
|
||
|
'name' => $row['name'],
|
||
|
'code_customer' => $row['code_customer'],
|
||
|
'lot_no' => $row['lot_no'],
|
||
|
'no_tlp' => $row['no_tlp'],
|
||
|
'address' => $row['address'],
|
||
|
]);
|
||
|
}
|
||
|
}
|