NilPortugues\Laravel5\JsonApi\Providers\Laravel52Provider::calculateRoute PHP Method

calculateRoute() protected method

protected calculateRoute ( array $value ) : mixed | string
$value array
return mixed | string
    protected function calculateRoute(array $value)
    {
        $router = Container::getInstance()->make('url');
        $route = '';
        /** @var \Illuminate\Routing\Route $routerObject */
        foreach ($this->getRouterCollection($router) as $routerObject) {
            if ($routerObject->getName() === $value['name']) {
                $route = $routerObject->getPath();
                return $this->calculateFullPath($value, $route);
            }
        }
        if (empty($route)) {
            throw new \Exception('Provided route name does not exist');
        }
    }