|string> */ public function rules(): array { $ruleId = $this->route('signInRewardRule')?->id; return [ 'streak_days' => [ 'required', 'integer', 'min:1', 'max:3650', Rule::unique('sign_in_reward_rules', 'streak_days')->ignore($ruleId), ], 'gold_reward' => ['required', 'integer', 'min:0', 'max:999999999'], 'exp_reward' => ['required', 'integer', 'min:0', 'max:999999999'], 'charm_reward' => ['required', 'integer', 'min:0', 'max:999999999'], 'identity_badge_code' => ['nullable', 'string', 'max:50'], 'identity_badge_name' => ['nullable', 'string', 'max:50'], 'identity_badge_icon' => ['nullable', 'string', 'max:120'], 'identity_badge_color' => ['nullable', 'string', 'max:20'], 'identity_duration_days' => ['required', 'integer', 'min:0', 'max:3650'], 'sort_order' => ['required', 'integer', 'min:0', 'max:999999'], 'is_enabled' => ['nullable', 'boolean'], ]; } /** * 方法功能:返回签到奖励规则表单的中文字段名。 * * @return array */ public function attributes(): array { return [ 'streak_days' => '连续签到天数', 'gold_reward' => '金币奖励', 'exp_reward' => '经验奖励', 'charm_reward' => '魅力奖励', 'identity_badge_name' => '身份名称', 'identity_duration_days' => '身份有效天数', ]; } }