logService = new OperationLogService(); $this->logService->menuTitle = 'vip_list'; } /** * @param array $row */ public function model(array $row) { if (!$this->index) { $this->index += 1; return; } $this->index += 1; $license = $row[1] ?? ''; if (empty($license)) { $this->error[] = imports_error($this->index, 'import33'); return; } $license_id = (new ParkingLicensePlateService( $this->logService ))->createLicenseId($license); if (ParkingVipList::query()->where('license_id', $license_id) ->exists() ) { $this->error[] = imports_error($this->index, 'import37'); return; } $model = ParkingVipList::query()->create([ 'license_id' => $license_id, 'user_id' => Auth::guard('sanctum')->user()['id'], 'created_at' => get_datetime() ]); $this->logService->logCreated($model, 'vip_list.create'); } public function errorArr(): array { return $this->error; } }