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.
24 lines
576 B
24 lines
576 B
<?php
|
|
|
|
namespace App\Imports;
|
|
|
|
use App\Models\AdminVipList;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Maatwebsite\Excel\Concerns\ToModel;
|
|
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
|
|
|
class AdminVipListImport implements ToModel, WithHeadingRow
|
|
{
|
|
/**
|
|
* @param array $row
|
|
* @return AdminVipList
|
|
*/
|
|
public function model(array $row): AdminVipList
|
|
{
|
|
return new AdminVipList([
|
|
'license' => $row['license'],
|
|
'user_id' => Auth::guard('sanctum')->user()['id'],
|
|
'created_at' => get_datetime()
|
|
]);
|
|
}
|
|
}
|
|
|