Fixes for validation

This commit is contained in:
David Bomba
2025-11-30 17:57:29 +11:00
parent d8b979be9e
commit ccb8ff566c
3 changed files with 13 additions and 5 deletions

View File

@@ -213,7 +213,7 @@ class Request extends FormRequest
}
if (array_key_exists('email', $contact)) {
$input['contacts'][$key]['email'] = trim($contact['email']);
$input['contacts'][$key]['email'] = trim($contact['email'] ?? '');
}
}
}

View File

@@ -184,6 +184,11 @@ class Account extends BaseModel
return self::class;
}
public function activities()
{
return $this->hasMany(Activity::class);
}
public function users(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(User::class)->withTrashed();

View File

@@ -33,7 +33,7 @@ class EntityLevel implements EntityLevelInterface
// 'state',
// 'postal_code',
// 'vat_number',
'country_id',
// 'country_id',
];
private array $company_settings_fields = [
@@ -206,9 +206,12 @@ class EntityLevel implements EntityLevelInterface
// $errors[] = ['field' => 'vat_number', 'label' => ctrans("texts.vat_number")];
// }
} elseif (empty($client->vat_number)) {
$errors[] = ['field' => 'vat_number', 'label' => ctrans("texts.vat_number")];
}
}
// elseif (empty($client->vat_number)) {
// $errors[] = ['field' => 'vat_number', 'label' => ctrans("texts.vat_number")];
// }
return $errors;