Define the routes for the application.

@param  \Illuminate\Routing\Router  $router
@return void
331249
public function setupRoutes(Router $router)
    {
        // by default, use the routes file provided in vendor
        $routeFilePathInUse = __DIR__.$this->routeFilePath;
        // but if there's a file with the same name in routes/backpack, use that one
        if (file_exists(base_path().$this->routeFilePath)) {
            $routeFilePathInUse = base_path().$this->routeFilePath;
        }
        $this->loadRoutesFrom($routeFilePathInUse);
    }
1358677
public function boot(Router $router)
	{
		$configPath = __DIR__.'/../config/theme.php';

		// Publish config.
		$this->publishes([$configPath => config_path('theme.php')], 'config');
	
	    $router->aliasMiddleware('theme', Middleware\ThemeLoader::class);

	    // Register blade directives:
		$this->addToBlade(['dd', 'dd(%s);']);
		$this->addToBlade(['dv', 'dd(get_defined_vars()[%s]);', 'dd(get_defined_vars()["__data"]);']);
		$this->addToBlade(['d', 'dump(%s);']);


		$this->addToBlade(['get', 'Theme::get(%s);']);
		$this->addToBlade(['getIfHas', 'Theme::has(%1$s) ? Theme::get(%1$s) : ""']);

		$this->addToBlade(['partial', 'Theme::partial(%s);']);
		$this->addToBlade(['sections', 'Theme::partial("sections.".%s);']);
		$this->addToBlade(['content', null, 'Theme::content();']);

		$this->addToBlade(['asset', 'Theme::asset()->absUrl(%s);']);

		$this->addToBlade(['protect', 'protectEmail(%s);']);

		$this->addToBlade(['styles', 'Theme::asset()->container(%s)->styles();', 'Theme::asset()->styles();']);
		$this->addToBlade(['scripts', 'Theme::asset()->container(%s)->scripts();', 'Theme::asset()->scripts();']);

		$this->addToBlade(['widget', 'Theme::widget(%s)->render();']);
	}
519434
public function boot(Router $router)
    {
        // Publish migrations, config and seeders
        $this->publishes([
            __DIR__.'/../migrations/' => base_path('/database/migrations')
        ], 'migrations');

        $this->publishes([
            __DIR__.'/../config/filer.php' => config_path('filer.php')
        ], 'config');

        $this->publishes([
            __DIR__.'/../seeds/' => base_path('/database/seeds')
        ], 'seeds');

        // Routes
        if (config('filer.routes')) {
            $router->group(['prefix' => config('filer.route_prefix'), 'middleware' => 'web'], function ($router) {
                Filer::routes($router);
            });
        }
    }
482432
public function addRoute(Route $route) {
        if (!in_array($route, $this->routes)) {
            $this->routes[] = $route;
        }
    }
1210139
protected function loadRoutes(Router $router)
    {
        $dir = $this->baseDir();
        $router->group([
            'namespace' => 'Riari\Forum\Http\Controllers',
            'as' => config('forum.routing.as'),
            'prefix' => config('forum.routing.root')
        ], function ($r) use ($dir) {
            require "{$dir}routes.php";
        });
    }
157723
public function map(Router $router)
    {
        $useMiddleware = version_compare($this->app->version(), '5.2.0', '>=') === true;
        $router->group([
            'prefix'     => config('codex.base_route') . '/' . config('codex-auth.route_prefix'),
            'namespace'  => $this->namespace,
            'as'         => 'codex.auth.',
            'middleware' => $useMiddleware ? [ 'web' ] : [],
        ], function ($router) {
            require realpath(__DIR__ . '/routes.php');
        });
    }
956414
protected function mapWebRoutes(Router $router)
    {
        $this->mapArticleRoutes($router);
        $this->mapCategoryRoutes($router);
        $this->mapTagsRoutes($router);
        $this->mapAdministratorAuthenticationRoutes($router);
        $this->mapAdministratorRoutes($router);
        $this->mapFrontendRoutes($router);
    }
796162
public function mapWebRoutes(Router $router)
    {
        $router->group(
            [
                'prefix' => $this->getRoutePrefix(),
                'as'     => $this->getRouteNamePrefix(),
            ],
            function (Router $router) {

                $controller = $this->getModelWebController();

                $router->post('references', [
                    'as'   => 'references',
                    'uses' => $controller . '@references',
                ]);
            }
        );
    }
533464
public function map(Router $router)
    {
        $router->group(['namespace' => $this->namespace, 'as' => 'core::'], function (Router $router) {
            $path = app_path('Http/Routes');

            $applyAlwaysAuthenticate = $this->app['config']->get('setting.always_authenticate', false);
            $AllFileIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
            $PhpFileIterator = new \RegexIterator($AllFileIterator, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH);

            foreach ($PhpFileIterator as $file => $object) {
                $class = substr($file, strlen($path));
                $class = str_replace('/', '\\', $class);
                $class = substr($class, 0, -4);

                $routes = $this->app->make("CachetHQ\\Cachet\\Http\\Routes${class}");

                if ($routes::$browser) {
                    $this->mapForBrowser($router, $routes, $applyAlwaysAuthenticate);
                } else {
                    $this->mapOtherwise($router, $routes, $applyAlwaysAuthenticate);
                }
            }
        });
    }
472277
public function setupRoutes(Router $router)
    {
        $router->group(['namespace' => 'LuisMareze\GeoManager\app\Http\Controllers'], function ($router) {
            // Admin Interface Routes
            Route::group(['middleware' => ['web', 'admin'], 'prefix' => 'admin'], function () {
                // LuisMareze\GeoManager routes
                Route::get('geo/create/{template}', 'Admin\GeoCrudController@create');
                Route::get('geo/{id}/edit/{template}', 'Admin\GeoCrudController@edit');

                // This triggered an error before publishing the GeoTemplates trait, when calling Route::controller();
                // CRUD::resource('geo', 'Admin\GeoCrudController');

                // So for GeoCrudController all routes are explicitly defined:
                Route::get('geo/reorder', 'Admin\GeoCrudController@reorder');
                Route::get('geo/reorder/{lang}', 'Admin\GeoCrudController@reorder');
                Route::post('geo/reorder', 'Admin\GeoCrudController@saveReorder');
                Route::post('geo/reorder/{lang}', 'Admin\GeoCrudController@saveReorder');
                Route::get('geo/{id}/details', 'Admin\GeoCrudController@showDetailsRow');
                Route::get('geo/{id}/translate/{lang}', 'Admin\GeoCrudController@translateItem');
                Route::resource('geo', 'Admin\GeoCrudController');
            });
        });
    }
982145
public function boot(\Illuminate\Routing\Router $router)
    {
        $this->publishes([
            __DIR__ . '/../publish/Middleware/' => app_path('Http/Middleware'),
        ]);

        $this->publishes([
            __DIR__ . '/../publish/migrations/' => database_path('migrations'),
        ]);

        $this->publishes([
            __DIR__ . '/../publish/Model/' => app_path(),
        ]);

        $this->publishes([
            __DIR__ . '/../publish/Controllers/' => app_path('Http/Controllers'),
        ]);

        $this->publishes([
            __DIR__ . '/../publish/resources/' => base_path('resources'),
        ]);

        $this->publishes([
            __DIR__ . '/../publish/crudgenerator.php' => config_path('crudgenerator.php'),
        ]);

        $this->publishes([
            __DIR__ . '/views' => base_path('resources/views/vendor/laravel-admin'),
        ], 'views');

        $this->loadViewsFrom(__DIR__ . '/views', 'laravel-admin');

        $menus = [];
        if (File::exists(base_path('resources/laravel-admin/menus.json'))) {
            $menus = json_decode(File::get(base_path('resources/laravel-admin/menus.json')));
            view()->share('laravelAdminMenus', $menus);
        }
    }
676138
protected function mapArticleRoutes(Router $router)
    {
        try {
            /** @var \Yajra\CMS\Repositories\Article\Repository $repository */
            $repository = app('articles');
            $repository->getAllPublished()->each(function (Article $article) use ($router) {
                $middleware = ['web'];
                if ($article->requiresAuthentication()) {
                    $middleware[] = 'auth';
                }

                if ($article->permissions->count()) {
                    if ($article->authorization === 'can') {
                        $article->permissions->each(
                            function (Permission $permission) use ($middleware) {
                                $middleware[] = 'can:' . $permission->slug;
                            }
                        );
                    } else {
                        $abilities    = $article->permissions->pluck('slug')->toArray();
                        $middleware[] = 'canAtLeast:' . implode(',', $abilities);
                    }
                }

                if ($article->hasTheme()) {
                    $middleware[] = 'theme:' . $article->getTheme();
                }

                $router->get($article->present()->slug,
                    function () use ($article, $router) {
                        return $this->app->call(ArticleController::class . '@show', [
                            'id'         => $article->id,
                            'parameters' => $router->current()->parameters(),
                        ]);
                    })->middleware($middleware)->name($article->getRouteName());

                /** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $breadcrumb */
                $breadcrumb = resolve(BreadcrumbsManager::class);
                $breadcrumb->register($article->getRouteName(),
                    function (BreadcrumbsGenerator $breadcrumbs) use ($article) {
                        if ($article->is_page) {
                            $breadcrumbs->parent('home');
                        } else {
                            $breadcrumbs->parent($article->category->getRouteName());
                        }
                        $breadcrumbs->push($article->title, route($article->getRouteName()));
                    }
                );
            });
        } catch (QueryException $e) {
            // \\_(",)_//
        }
    }
703231
public function map(Router $router)
    {
        $router->group($this->routeAttributes(), function(Router $router) {
            LogViewerRoute::register($router);
        });
    }
1046453
public function boot(Router $router)
    {
        $this->publishAssets();
        $this->registerRoutes($router);
        $this->loadViewsFrom(__DIR__.'/Resources/views', 'beanstalkdui');
        $this->registerViewComposer();
    }
745998
public function map(Router $router)
    {
        /** @var Tenant $tenant */
        $tenant = $this->app->make('auth.tenant');
        $router->group(
            ['namespace' => $this->namespace],
            function ($router) use ($tenant) {
                $tries = ['routes'];

                if ($tenant->getTenantOwner() instanceof DomainAwareTenantParticipant) {
                    array_unshift($tries, $tenant->getTenantOwner()->getDomain());
                }
                if ($tenant->getTenantCreator() instanceof DomainAwareTenantParticipant) {
                    array_unshift($tries, $tenant->getTenantCreator()->getDomain());
                }

                foreach ($tries as $file) {
                    $path = app_path(sprintf('Http/%s.php', $file));
                    if (file_exists($path)) {
                        require_once $path;
                        return;
                    }
                }

                throw new \RuntimeException('No routes found in: ' . implode(', ', $tries));
            }
        );
    }
495702
public function mapApiRoutes(Router $router)
    {
        foreach ($this->modules as $module) {
            $module->mapApiRoutes($router);
        }
    }
35865
public function mapWebRoutes(Router $router)
    {
        $permissionPrefix = $this->routeHelper->getPermissionPrefixForModelSlug(
            $this->getModelSlug()
        );

        $router->group(
            [
                'prefix'    => $this->getRoutePrefix(),
                'as'        => $this->getRouteNamePrefix(),
                'middleware' => [ cms_mw_permission("{$permissionPrefix}*") ],
            ],
            function (Router $router) use ($permissionPrefix) {

                $controller = $this->getModelWebController();

                $router->get('/', [
                    'as'   => 'index',
                    'uses' => $controller . '@index',
                ]);

                $router->get('create', [
                    'as'         => 'create',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}create")],
                    'uses'       => $controller . '@create',
                ]);

                $router->post('/', [
                    'as'         => 'store',
                    'middleware' => [
                        cms_mw_permission("{$permissionPrefix}create"),
                        StoreActiveFormContext::class,
                    ],
                    'uses'       => $controller . '@store',
                ]);

                $router->post('filter', [
                    'as'   => 'filter',
                    'uses' => $controller . '@filter',
                ]);

                $router->get('export/{strategy}', [
                    'as'         => 'export',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}export")],
                    'uses'       => $controller . '@export',
                ]);

                $router->get('{key}', [
                    'as'   => 'show',
                    'uses' => $controller . '@show',
                ]);

                $router->get('{key}/edit', [
                    'as'         => 'edit',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@edit',
                ]);

                $router->put('{key}/activate', [
                    'as'         => 'activate',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@activate',
                ]);

                $router->put('{key}/position', [
                    'as'         => 'position',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@position',
                ]);

                $router->get('{key}/deletable', [
                    'as'         => 'deletable',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}delete")],
                    'uses'       => $controller . '@deletable',
                ]);

                $router->put('{key}', [
                    'as'         => 'update',
                    'middleware' => [
                        cms_mw_permission("{$permissionPrefix}edit"),
                        StoreActiveFormContext::class,
                    ],
                    'uses'       => $controller . '@update',
                ]);

                $router->delete('{key}', [
                    'as'         => 'destroy',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}delete")],
                    'uses'       => $controller . '@destroy',
                ]);
            }
        );
    }