|string> */ public function rules(): array { return [ 'name' => [ 'sometimes', 'required', 'string', 'max:255', Rule::unique('labels', 'name') ->where('user_id', auth()->id()) ->whereNull('deleted_at') ->ignore($this->route('savingsGoal')?->label_id), ], 'target_amount' => ['sometimes', 'required', 'integer', 'min:1'], 'target_date' => ['nullable', 'date'], ]; } /** * @return array */ public function messages(): array { return [ 'name.unique' => __('You already have a label or goal with this name.'), ]; } }