I have a form for making projects and the name should be unique, but it should only match unique names with other active projects (so theres no two active projects with the same name). But it does not matter if the name is equal to inactive projects names. It's a weird request but I'm looking how to implement this.
Does anyone know a good way of implementing this via form objects or model?
Currently the validation for the field in the model looks like this.
public function validation()
{
$validator = new Validation();
$validator->add(
"name",
new Uniqueness(
[
"message" => "The name must be unique",
]
)
);
return $this->validate($validator);
}