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