当访问不存在的控制器或方法时，将回调此方法

@param Router $router
@throws \Exception
979686
public function notfound() {
        $router = Router::driver();
        quit('Cli Not Found:' .  $router->module. '/' .$router->controller . '/' . $router->function."\n");
    }
830586
public function registerMiddleware(Router $router)
    {
        foreach ($this->middleware as $module => $middlewares) {
            foreach ($middlewares as $name => $middleware) {
                $class = "Modules\\{$module}\\Http\\Middleware\\{$middleware}";

                $router->middleware($name, $class);
            }
        }
    }
296818
public function boot(Router $router)
    {
        Schema::defaultStringLength(191);
        $router->group(
            [
                'prefix' => null,
                'namespace' => 'Tyondo\\Notifications\\Controllers',
            ], function(){
            $this->loadRoutesFrom(__DIR__.'/Routes/web.php');
        }
        );


        // Merge config files
        $this->mergeConfigFrom(__DIR__.'/Config/tyondo_notifications.php', $this->packageName);
		// Register Views
        //$this->loadViewsFrom(__DIR__.'/views', $this->packageName);


    }
1043117
public function match(MainRouter $router, $route = null)
    {
        $route = $route ?: $this->app->uri->route;
        $route = $route ?: '/';

        $input   = $this->app->input;
        $request = $this->app->request;

        if ($request->hasHeader('X-HTTP-Method-Override')) {
            $method = $request->getHeaderLine('X-HTTP-Method-Override');
        } else {
            $method = $input->get('_method') ?: $input->getMethod();
        }

        // Pass variables to custom method
        if ($input->$method) {
            $httpMethod = $input->getMethod();

            $input->$method->setData($input->$httpMethod->toArray());
        }

        // Prepare option data
        $uri = $request->getUri();

        $options = [
            'scheme' => $uri->getScheme(),
            'host' => $uri->getHost(),
            'port' => $uri->getPort(),
        ];

        try {
            return $router->match($route, $method, $options);
        } catch (RouteNotFoundException $e) {
            // If simple_route is disabled, just continue throw the exception.
            if (!$this->app->get('routing.simple_route', false)) {
                throw $e;
            }

            // Simple routing
            $matched = $this->matchSimpleRouting($route, $method, $router);

            if ($matched === false) {
                throw new RouteNotFoundException($e->getMessage(), $e->getCode(), $e);
            }

            return $matched;
        }
    }
956414
protected function mapWebRoutes(Router $router)
    {
        $this->mapArticleRoutes($router);
        $this->mapCategoryRoutes($router);
        $this->mapTagsRoutes($router);
        $this->mapAdministratorAuthenticationRoutes($router);
        $this->mapAdministratorRoutes($router);
        $this->mapFrontendRoutes($router);
    }
905261
public function map(Router $router)
    {
        $api = app('Dingo\Api\Routing\Router');

        $this->loadApiRoutes($api, $router);

        $router->group(['namespace' => $this->namespace], function (Router $router) {
            $this->loadBackendRoutes($router);
            $this->loadFrontendRoutes($router);
        });
    }
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));
            }
        );
    }
657009
public function map(Router $router)
    {
        $router->group($this->routeAttributes(), function(Router $router) {
            \Antares\Logger\Http\Routes\LoggerRoute::register($router);
        });
    }
1309988
protected function loadRoutes(Router $router)
    {
        $router->group([
            'namespace' => $this->namespace,
            'middleware' => config('forum.frontend.middleware'),
            'as' => config('forum.routing.as'),
            'prefix' => config('forum.routing.prefix')
        ], function ($router) {
            Forum::routes($router);
        });
    }
691107
public function load(Router $router, $basepath)
    {
        $loader = new RouteLoader();
        $loader->registerRouter($router);
        $this->_route = $loader->getRequestedRoute($basepath);

        if (isset($this->_route['method']) && $this->_route['method'] == $_SERVER['REQUEST_METHOD']) {
            $controller = 'App\Controllers\\'.$this->_route['controller'];

            if (!class_exists($controller)) {
                throw new \Exception("Class [{$this->_route['controller']}] does not exist!");
            }

            $class = new $controller($this->_route);
            $method = $this->_route['action'];

            if (isset($this->_route['query'])) {
                $request = new Request();

                if (method_exists($class, $method)) {
                    $class->$method($request->setRequest($this->_route['query'])->getObject());
                } else {
                    throw new \Exception("Method [$method] is not defined in $controller!");
                }
            } else {
                if (method_exists($class, $method)) {
                    $class->$method();
                } else {
                    throw new \Exception("Method [$method] is not defined in $controller!");
                }
            }
        } else {
            $this->loadErrorPage('404');
        }
    }
1185596
public function initializeRouter()
    {
        try {
            // initialize router
            $this->router = Router::getInstance();

            // if a route is matched, a dispatcher instance is returned, and the callback is issued
            $this->router->initializeRouter()->issueCallback();
        } catch (BootstrapException $e) {
            throw $e;
        }
    }
898660
public function boot(Router $router)
    {
        if ($this->app->runningInConsole()) {
            $this->publishes([
                __DIR__.'/../database/migrations' => database_path('migrations'),
            ], 'migrations');

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

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

        $this->registerMiddleware($router);

        $this->registerComposers();
    }
1050404
public static function delete(Route $route)
    {
        $routeWithoutSlash = $route;
        $routeWithSlash = $route->getWithSlash();

        // exception_if(! check(self::$register[$routeWithoutSlash->getName()]), RouteNotFoundInRoutesRegisterException::class , $routeWithoutSlash);
        // exception_if(! check(self::$register[$routeWithSlash->getName()]), RouteNotFoundInRoutesRegisterException::class , $routeWithSlash);

        if (check(self::$register[$routeWithoutSlash->getName()])) {
            unset(self::$register[$routeWithoutSlash->getName()]);
        }

        if (check(self::$register[$routeWithSlash->getName()])) {
            unset(self::$register[$routeWithSlash->getName()]);
        }
    }
1046453
public function boot(Router $router)
    {
        $this->publishAssets();
        $this->registerRoutes($router);
        $this->loadViewsFrom(__DIR__.'/Resources/views', 'beanstalkdui');
        $this->registerViewComposer();
    }
468775
public function boot(Router $router)
    {
        /** @var Application $app */
        $app = $this->app;

        $this->commands($this->commands);

        if (!$app->routesAreCached()) {
            $this->loadRoutes($router);
        }

        $this->loadMigrations();

        $this->loadTranslations();

        $this->registerPublishes();
    }
380763
public function mapApiRoutes(Router $router)
    {
        $router->group(
            [
                'prefix' => $this->getRoutePrefix(),
                'as'     => $this->getRouteNamePrefix(),
            ],
            function (Router $router) {

                $controller = $this->getModelApiController();

                $router->post('references', [
                    'as'   => 'references',
                    'uses' => $controller . '@references',
                ]);
            }
        );
    }
1238232
protected function registerRoutes(Router $router)
    {
        $debug = $this->app->make(MailDebugManager::class);

        $router->get('mail-debug/{file}', function ($file) use ($debug) {
            if (file_exists($path = $debug->storage().'/'.$file)) {
                include $path;
                return;
            }

            return abort(404);
        })->name('mail-debug');
    }