data = $data; return $this; } public function validate(string $attribute, mixed $value, Closure $fail): void { $selected = (array) Arr::get($this->data, $this->listAttribute, []); if (in_array($this->key, $selected, true) && trim((string) $value) === '') { $fail(__('validation.required', ['attribute' => __('Other')])); } } }