getFieldRules(), $this->getFilterRules(), $this->getIncludeRules(), $this->getPagingRules(), $this->getSearchRules(), $this->getSortRules(), ); } /** * Get the field validation rules. */ protected function getFieldRules(): array { $schema = $this->schema(); $types = Arr::wrap($schema->type()); $rules = $this->restrictAllowedFieldValues($schema); foreach ($schema->allowedIncludes() as $allowedInclude) { $relationSchema = $allowedInclude->schema(); $types[] = $relationSchema->type(); $rules += $this->restrictAllowedFieldValues($relationSchema); } return $rules + $this->restrictAllowedTypes(FieldParser::param(), $types); } /** * Get the filter validation rules. */ abstract protected function getFilterRules(): array; /** * Get include validation rules. */ protected function getIncludeRules(): array { $schema = $this->schema(); if (blank($schema->allowedIncludes())) { return $this->prohibit(IncludeParser::param()); } return $this->restrictAllowedIncludeValues(IncludeParser::param(), $schema); } /** * Get the paging validation rules. */ abstract protected function getPagingRules(): array; /** * Get the search validation rules. */ abstract protected function getSearchRules(): array; /** * Get the sort validation rules. */ abstract protected function getSortRules(): array; }