@param \Laravel\Nova\Resource $resource

@return array
1549
public function indexFields(Resource $resource): array
    {
        return $this->resourceFields($resource)->map(function (Field $field) {
            if (!$field->computed()) {
                return $field->attribute;
            }

            return $field->name;
        })->unique()->all();
    }
856497
protected function parseComposerContent($resource)
    {
        $composer = (array) JsonFile::parseJson($this->getContents($resource));
        if (empty($composer['content']) || 'base64' !== $composer['encoding'] || !($composer = base64_decode($composer['content'], true))) {
            throw new \RuntimeException('Could not retrieve '.$this->repoConfig['filename'].' from '.$resource);
        }

        return $composer;
    }
557505
public static function getMappings($resource, $key = 'default')
	{
		$resourceName = $resource;

		if( is_object($resource) )
		{
			$resourceName = get_class($resource);
		}

		$mappings = [];
		if( isset(self::$mappers[$key]) )
		{
			$mappings = array_merge_recursive( $mappings, call_user_func(self::$mappers[$key], $resourceName) );
		}

		if( isset(self::$mappings[$key]) && isset(self::$mappings[$key][$resourceName]) )
		{
			$mappings = array_merge_recursive( $mappings, (array) self::$mappings[$key][$resourceName] );
		}

		return $mappings;
	}
475516
protected function getResourceAction($resource, $controller, $method, $options)
    {
        $name = $this->getResourceName($resource, $method, $options);

        return array('as' => $name, 'uses' => $controller .'@' .$method);
    }
1347386
public function getIssue($resource)
    {
        $hashPosition = strpos($resource, '#');
        if ($hashPosition !== false) {
            $resource = substr($resource, 0, $hashPosition);
        }

        $url = $this->host . '/browse/';

        if (strncmp($resource, $url, strlen($url)) === 0) {
            return substr($resource, strlen($url));
        }
    }
1138966
private function load($resource, string $type = null): array
    {
        if (null === $this->loader) {
            throw new \BadMethodCallException('Cannot import other routing resources: you must pass a LoaderInterface when constructing RouteCollectionBuilder.');
        }

        if ($this->loader->supports($resource, $type)) {
            $collections = $this->loader->load($resource, $type);

            return \is_array($collections) ? $collections : [$collections];
        }

        if (null === $resolver = $this->loader->getResolver()) {
            throw new LoaderLoadException($resource, null, null, null, $type);
        }

        if (false === $loader = $resolver->resolve($resource, $type)) {
            throw new LoaderLoadException($resource, null, null, null, $type);
        }

        $collections = $loader->load($resource, $type);

        return \is_array($collections) ? $collections : [$collections];
    }
633345
public function getForResource($resource)
    {
        $resourceName = $this->resourceName($resource);

        if (isset($this->resourceFactories[$resourceName])) {
            return $this->resourceFactories[$resourceName];
        }

        throw new HandlerNotFoundException("No handler found for resource '$resourceName'");

    }
1203640
public function findAllByResourceAndNames($resource, array $params)
    {
        $where = $this->getWhere(['resource' => $resource]);
        $model = $this->makeModel()->getModel()->widgetParams()->getModel()->newQuery();
        return $model->where($where)->whereIn('name', $params)->get()->toArray();
    }
1313965
public static function toSerialize($resource) {
		if (!self::isArray($resource)) {
			$resource = self::toArray($resource);
		}

		return serialize($resource);
	}
256603
protected function _loadResource($resource) {
        return $this->cache([__METHOD__, $resource], function() use ($resource) {
            $data = $this->getLocaleBundle()->loadResource(null, $resource);

            if ($parent = $this->getParentLocale()) {
                $data = array_merge(
                    $parent->getLocaleBundle()->loadResource(null, $resource),
                    $data
                );
            }

            return $data;
        });
    }
311052
public function load($resource)
    {
        if ($issue = $this->getIssue($resource)) {
            return $this->createFeature($issue);
        }

        return $this->createFeatures();
    }
1242651
protected function getFilename(Resource $resource)
    {
        return sprintf(
            '%s/%s%s',
            $this->dir,
            md5(serialize($resource)),
            $this->suffix
        );
    }
215228
protected function executeOnMulitpleResources(array $resources): array
    {
        $results = [];

        foreach ($resources as $resource) {
            $results[$resource->name()] = $this->executeOn($resource);
        }

        return $results;
    }
1186979
public function findByResource(ResourceNode $resource)
    {
        return $this->createQueryBuilder('c')
            ->select('c')
            ->join('c.resources', 'r')
            ->where('r = :resource')
            ->setParameter(':resource', $resource)
            ->getQuery()
            ->getResult();
    }
1208642
public function types(Request $request)
    {
        if (!$resourceId = static::getResourceId($request)) {
            return [];
        }

        $type = optional($this->model()->whereId($resourceId)->first())->type;

        if (method_exists($type, 'types')) {
            return $type::types();
        };

        if (method_exists($type, 'sourceTypes')) {
            return $type::sourceTypes();
        };

        return [];
    }
193782
public function load($resource, $type = null): array
    {
        try {
            $path = $this->locator->locate($resource);
            $file = $this->filesystem->openFile($path);
            $configValues = $this->yamlParser->parse($file->getContents());

            return $configValues;
        } catch (FileLocatorFileNotFoundException $error) {
            return [];
        }
    }
1317859
protected function getAllowedMethods(string $resource)
    {
        $cached = $this->cache['allowed_methods'][$resource] ?? null;
        if ($cached !== null) {
            return $cached;
        }

        $resource_data = $this->resources[$resource] ?? null;
        if ($resource_data === null) {
            throw new \DomainException("Invalid resource '$resource'");
        }

        $allow = $this->implemented_methods;

        $methods = (array) ($resource_data['methods'] ?? null);
        if (!empty($methods)) {
            $allow = array_intersect(
                $allow,
                array_merge($methods, ['OPTIONS'])
            );
        }

        $this->cache['allowed_methods'][$resource] = $allow;
        return $allow;
    }