protected function registerSettingsMacro(Router $router)
{
$manageMacro = function ($key, Closure $callback, $routeOptions = null) {
$key = str_replace('.', '/', $key);
$attributes = ['prefix' => config('xe.routing.settingsPrefix') . '/' . $key, 'middleware' => ['settings']];
if ($routeOptions !== null and is_array($routeOptions)) {
$routeOptions = array_except($routeOptions, ['prefix']);
$attributes = array_merge($attributes, $routeOptions);
}
$this->group($attributes, $callback);
};
$router->macro('settings', $manageMacro);
}