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;
            }
        });
    }