getAccountIdFromName($row); } if (empty($row['account_id']) && !empty($row['account_number'])) { $row['account_id'] = $this->getAccountIdFromNumber($row); } if (empty($row['account_id']) && !empty($row['currency_code'])) { $row['account_id'] = $this->getAccountIdFromCurrency($row); } if (empty($row['contact_id']) && !empty($row['contact_name'])) { $row['contact_id'] = $this->getContactIdFromName($row, 'customer'); } if (empty($row['contact_id']) && !empty($row['contact_email'])) { $row['contact_id'] = $this->getContactIdFromEmail($row, 'customer'); } if (empty($row['category_id']) && !empty($row['category_name'])) { $row['category_id'] = $this->getCategoryIdFromName($row, 'income'); } if (!empty($row['invoice_number'])) { $row['document_id'] = Invoice::number($row['invoice_number'])->pluck('id')->first(); } return $row; } public function rules(): array { return (new Request())->rules(); } }