/** * Bootstrap the application services. * * @return void */ public function boot() { $this->bootPublish(); // Extends Url Generator $this->app->bind('url', function ($app) { return new UrlGenerator($app['router']->getRoutes(), $app['request']); }); $this->app->bind('Illuminate\\Routing\\ResourceRegistrar', function ($app) { return new ResourceRegistrar($app['router']); }); try { Site::init(); $router = $this->app['router']; $config = $this->app['config']; // DEBUG BAR liveCMSRouter($router, function ($router, $adminSlug, $subDomain, $subFolder) use($config) { // EXTEND ROUTER $router->group(['namespace' => 'LiveCMS\\Controllers'], function ($router) use($adminSlug, $subDomain, $subFolder) { require $this->baseDir() . '/routebases.php'; }); }); } catch (\Exception $e) { throw new \Exception('Error in LiveCMSServiceProvider : ' . $e->getMessage()); } }
/** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. * * @return void */ protected function mapWebRoutes() { Route::group(['middleware' => 'web', 'namespace' => $this->namespace], function ($router) { liveCMSRouter($router, function ($router, $adminSlug, $subDomain, $subFolder) { require base_path('routes/web.php'); frontendRoute($router); }); }); }