info = new FieldInfo("slug", "Slug", FieldType::STRING); } public function format(array $input, array $output): array { $value = !empty($input[$this->name]) ? (string)$input[$this->name] : null; if(empty($value)){ $value = Str::slug($input[$this->source]); } $output[$this->name] = (new Nullable($this->nullable, $value, ""))->value(); return $output; } public function failRequired(mixed $value): bool { return empty(trim($value)); } }