isMethod('post'); return [ 'rating' => [$isCreating ? 'required' : 'sometimes', 'integer', 'min:1', 'max:5'], 'comment' => ['sometimes', 'nullable', 'string', 'max:1000'], ]; } public function authorize(): bool { return true; } }