"The name may only contain letters (including Unicode), numbers, spaces, and these characters: - _ . / @ &", 'name.min' => 'The name must be at least :min characters.', 'name.max' => 'The name may not be greater than :max characters.', ]; } /** * Get validation messages for description fields */ public static function descriptionMessages(): array { return [ 'description.regex' => "The description may only contain letters (including Unicode), numbers, spaces, and common punctuation: - _ . , ! ? ( ) ' \" + = * / @ &", 'description.max' => 'The description may not be greater than :max characters.', ]; } /** * Get validation rules for file path fields (dockerfile location, docker compose location) */ public static function filePathRules(int $maxLength = 255): array { return ['nullable', 'string', 'max:'.$maxLength, 'regex:'.self::FILE_PATH_PATTERN]; } /** * Get validation messages for file path fields */ public static function filePathMessages(string $field = 'dockerfileLocation', string $label = 'Dockerfile'): array { return [ "{$field}.regex" => "The {$label} location must be a valid path starting with / and containing only alphanumeric characters, dots, hyphens, underscores, slashes, @, ~, and +.", ]; } /** * Get combined validation messages for both name and description fields */ public static function combinedMessages(): array { return array_merge(self::nameMessages(), self::descriptionMessages()); } }