entities->get($requestData['type']); return $entityType->newQuery()->scopes(['visible'])->findOrFail($requestData['id']); } /** * Get the validation rules for an abstract entity request. * @return array{type: string[], id: string[]} */ public function validationRules(): array { return [ 'type' => ['required', 'string'], 'id' => ['required', 'integer'], ]; } }