*/ public function rules(): array { return [ 'reviewer_id' => ['required', 'integer', 'exists:reviewers,id'], 'competition_id' => ['required', 'integer', 'exists:competitions,id'], 'track_code' => [ 'required', 'string', 'max:64', Rule::exists('competition_tracks', 'track_code') ->where('competition_id', $this->input('competition_id')) ->where('is_enabled', true), Rule::unique('reviewer_scopes', 'track_code') ->where('reviewer_id', $this->input('reviewer_id')) ->where('competition_id', $this->input('competition_id')), ], ]; } /** * @return array */ public function attributes(): array { return [ 'track_code' => '赛道编码', 'reviewer_id' => '评审员', 'competition_id' => '赛事', ]; } }