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.
29 lines
687 B
29 lines
687 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'],
|
||
|
'email' => $row['email'],
|
||
|
'address' => $row['address'],
|
||
|
]);
|
||
|
}
|
||
|
}
|