src/Route.php
public static function init($slug, $name, $endpoints = null, $type = Config::TYPE_COLLECTION)
    {
        $instance = new static();

        $instance->route = [];

        if (is_array($name)) {
            $section = key($name);
            $name = $name[$section];
        } else {
            $section = $name;
        }

        $instance->route['slug'] = $slug;
        $instance->route['name'] = $name;
        $instance->route['section'] = $section;
        $instance->route['type'] = $type;
        $instance->route['endpoints'] = self::makeEndpoints($endpoints);
        $instance->route['groups'] = collect([]);
        $instance->route['icon'] = 'filter_list';

        return $instance;
    }
public static function init($slug, $name, $endpoints = null, $type = Config::TYPE_COLLECTION)
    {
        $instance = new static();

        $instance->route = [];

        if (is_array($name)) {
            $section = key($name);
            $name = $name[$section];
        } else {
            $section = $name;
        }

        $instance->route['slug'] = $slug;
        $instance->route['name'] = $name;
        $instance->route['section'] = $section;
        $instance->route['type'] = $type;
        $instance->route['endpoints'] = self::makeEndpoints($endpoints);
        $instance->route['groups'] = collect([]);
        $instance->route['icon'] = 'filter_list';

        return $instance;
    }
public static function init ( $ slug , $ name , $ endpoints = null , $ type = Config :: TYPE_COLLECTION ) { $ instance = new static ( ) ; $ instance -> route = [ ] ; if ( is_array ( $ name ) ) { $ section = key ( $ name ) ; $ name = $ name [ $ section ] ; } else { $ section = $ name ; } $ instance -> route [ 'slug' ] = $ slug ; $ instance -> route [ 'name' ] = $ name ; $ instance -> route [ 'section' ] = $ section ; $ instance -> route [ 'type' ] = $ type ; $ instance -> route [ 'endpoints' ] = self :: makeEndpoints ( $ endpoints ) ; $ instance -> route [ 'groups' ] = collect ( [ ] ) ; $ instance -> route [ 'icon' ] = 'filter_list' ; return $ instance ; }
Initialise a new route. This must be called before any other method on the class

@param string $slug
@param string $name
@param string|Array $endpoints
@param string $type
@return Agencms\Core\Route
Initialise a new route . This must be called before any other method on the class