public function map(Router $router)
    {
        $addon = $this->addon();
        $config = $addon->config('addon.routes');

        $attributes = [
            'domain' => array_get($config, 'domain', null),
            'prefix' => array_get($config, 'prefix', ''),
            'namespace' => array_get($config, 'namespace', $addon->phpNamespace().'\\Controllers'),
            'middleware' => array_get($config, 'middleware', []),
        ];

        $files = array_map(function ($file) use ($addon) {
            return $addon->path($file);
        }, array_get($config, 'files', ['classes/Http/routes.php']));

        $router->group($attributes, function ($router) use ($files) {
            foreach ($files as $file) {
                require $file;
            }
        });
    }
public function map(Router $router)
    {
        $addon = $this->addon();
        $config = $addon->config('addon.routes');

        $attributes = [
            'domain' => array_get($config, 'domain', null),
            'prefix' => array_get($config, 'prefix', ''),
            'namespace' => array_get($config, 'namespace', $addon->phpNamespace().'\\Controllers'),
            'middleware' => array_get($config, 'middleware', []),
        ];

        $files = array_map(function ($file) use ($addon) {
            return $addon->path($file);
        }, array_get($config, 'files', ['classes/Http/routes.php']));

        $router->group($attributes, function ($router) use ($files) {
            foreach ($files as $file) {
                require $file;
            }
        });
    }
public function map ( Router $ router ) { $ addon = $ this -> addon ( ) ; $ config = $ addon -> config ( 'addon.routes' ) ; $ attributes = [ 'domain' => array_get ( $ config , 'domain' , null ) , 'prefix' => array_get ( $ config , 'prefix' , '' ) , 'namespace' => array_get ( $ config , 'namespace' , $ addon -> phpNamespace ( ) . '\\Controllers' ) , 'middleware' => array_get ( $ config , 'middleware' , [ ] ) , ] ; $ files = array_map ( function ( $ file ) use ( $ addon ) { return $ addon -> path ( $ file ) ; } , array_get ( $ config , 'files' , [ 'classes/Http/routes.php' ] ) ) ; $ router -> group ( $ attributes , function ( $ router ) use ( $ files ) { foreach ( $ files as $ file ) { require $ file ; } } ) ; }
Define the routes for the addon.

@param  \Illuminate\Routing\Router  $router  (injection)
@return void
Define the routes for the addon .