Get all route names for the specified resource.

@param string $resourceName The name of the resource.

@return array
777817
protected function getAllRouteNames($resourceName = null)
    {
        $resourceName = $resourceName ?? $this->resourceName;

        return [
            'index'   => $this->prefix.$this->resourceName.'.index',
            'create'  => $this->prefix.$this->resourceName.'.create',
            'store'   => $this->prefix.$this->resourceName.'.store',
            'show'    => $this->prefix.$this->resourceName.'.show',
            'edit'    => $this->prefix.$this->resourceName.'.edit',
            'update'  => $this->prefix.$this->resourceName.'.update',
            'destroy' => $this->prefix.$this->resourceName.'.destroy',
        ];
    }
903465
public function resourceName($value = null)
    {
        if ($value === null) {
            return $this->_action()->resourceName();
        }

        return $this->_action()->resourceName($value);
    }
247015
def get_route_name(resource_uri):
    
    resource_uri = resource_uri.strip('/')
    resource_uri = re.sub('\W', '', resource_uri)
    return resource_uri
748513
public function seeInCurrentRoute($routeName)
    {
        $router = $this->grabService('router');
        if (!$router->getRouteCollection()->get($routeName)) {
            $this->fail(sprintf('Route with name "%s" does not exists.', $routeName));
        }

        $uri = explode('?', $this->grabFromCurrentUrl())[0];
        try {
            $matchedRouteName = $router->match($uri)['_route'];
        } catch (\Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
            $this->fail(sprintf('The "%s" url does not match with any route', $uri));
        }

        $this->assertEquals($matchedRouteName, $routeName);
    }
695900
public function loadResource($resourceName)
		{
			$resourceLocation = dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."res".DIRECTORY_SEPARATOR.$resourceName;
			$this->resourceContent = $this->readResourceToArray($resourceLocation);
		}
315824
public function resourceConfigurationFor($resourceName)
    {
        foreach ($this->resourceConfigurations as $config) {
            if ($config->getResource() === $resourceName) {
                return $config;
            }
        }

        return null;
    }
1001840
protected function addRoutes()
    {
		return ["Route::delete('" . $this->routeName . "/arr-delete', '" . $this->controller . "@arrDelete')->name('" . $this->myAddrName . ".arrDelete');\nRoute::resource('" . $this->routeName . "', '" . $this->controller . "');"];
    }
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;
	}
20551
public function fetchPairsByResourceName(): array
	{
		$result = [];
		$rows = $this->findByResource();
		foreach ($rows as $row) {
			$result[$row->id] = $row->resource . ($this->translator ? ' - ( ' . $this->translator->translate($row->name) . ' )' : '');
		}
		return $result;
	}
258055
public function getRequestUrl($resourceName, $query)
    {
        $requestUrl = $this->endpoint . '/' . $resourceName;
        if ($query) {
            if (is_array($query)) {
                $query = http_build_query($query);
            }
            $requestUrl .= '?' . $query;
        }

        return $requestUrl;
    }
601082
protected function getRoutePermissions(string $routeName)
    {
        //If permissions are defined for an individual route, pattern permissions are completely ignored for that route.
        $tree = $this->treeBuilder->getTree();

        //Check individual route permissions
        if (!empty($tree['routes']) && array_key_exists($routeName, $tree['routes'])) {
            return $tree['routes'][$routeName];
        }

        //Check pattern permissions
        if (!empty($tree['route_patterns'])) {
            $route = $this->router->getRouteCollection()->get($routeName);
            if ($route) {
                $routePath = $route->getPath();
                foreach ($tree['route_patterns'] as $pattern => $permissions) {
                    if (preg_match("@$pattern@", $routePath)) {
                        return $permissions;
                    }
                }
            }
        }

        return [];
    }
952848
public function resourceName()
    {
        if (!$this->_resourceName) {
            $this->_resourceName = str_replace('_', '-', $this->getTable());
        }
        return $this->_resourceName;
    }
915402
public function getAllRoutes()
    {
        $routes = [];
        foreach ($this->getRoutes() as $path => $route) {
            if (array_key_exists('slug', $route)) {
                $routes[$route['slug']] = $path;
            }
        }
        return $routes;
    }
1079104
protected function getRoutes()
    {
        $c = self::ROUTE_PATTERN_CONTROLLER;
        $a = self::ROUTE_PATTERN_ACTION;
        $p = self::ROUTE_PATTERN_PARAMS;
        return array(
            "/" => self::MATCHES_NOTHING,
            "/$c" => self::MATCHES_CONTROLLER,
            "/$c/" => self::MATCHES_CONTROLLER,
            "/$c/$a" => self::MATCHES_CONTROLLER_AND_ACTION,
            "/$c/$a/" => self::MATCHES_CONTROLLER_AND_ACTION,
            "/$c/$a/$p" => self::MATCHES_CONTROLLER_ACTION_AND_PARAMS
        );
    }
56397
public function getUrlsList($instanceName)
    {
        // FIXME: $instanceName is no more needed! o_O
        $urlsList = [];

        if ($this->controllerDetector) {
            $detectedControllers = array_values($this->controllerDetector->getControllerIdentifiers($this->controllerAnalyzer));
            $detectedControllers = array_combine($detectedControllers, $detectedControllers);

            $controllers = $this->controllers + $detectedControllers;
        } else {
            $controllers = $this->controllers;
        }

        foreach ($controllers as $controllerInstanceName) {
            $routes = $this->controllerAnalyzer->analyzeController($controllerInstanceName);

            $urlsList = array_merge($urlsList, $routes);
        }

        return $urlsList;
    }
697235
public function getRoutes()
    {
        $manager = RBACHelper::getAuthManager();
        $routes = $this->getAppRoutes();
        $exists = [];
        foreach (array_keys($manager->getPermissions()) as $name) {
            if ($name[0] !== '/') {
                continue;
            }
            $exists[] = $name;
            unset($routes[$name]);
        }
        return [
            'avaliable' => array_keys($routes),
            'assigned' => $exists
        ];
    }
1324995
public function getByRouteName($routeName)
    {
        $this->fireLoadEvent();
        if (isset($this->pageTypesByRouteName[$routeName])) {
            return $this->pageTypesByRouteName[$routeName];
        }
    }