code: protected function relationshipRules($record, string $field): array
      {
          return collect($this->rules($record))->filter(function ($v, $key) use ($field) {
              return Str::startsWith($key, $field);
          })->all();
      }
docs: Get validation rules for a specified relationship field.
  
  @param mixed $record
  @param string $field
  @return array