Ejemplo n.º 1
0
 /**
  * Get Route objects in an array.
  *
  * @return mixed
  */
 public function getRoutes()
 {
     if (!is_null($this->router->getRoutes())) {
         return $this->router->getRoutes()->getRoutes();
     }
     return null;
 }
Ejemplo n.º 2
0
 /**
  * Bootstrap any application services.
  *
  * @param  \Illuminate\Contracts\Routing\Registrar  $router
  * @return void
  */
 public function boot(Registrar $router)
 {
     $this->setRootControllerNamespace();
     if ($this->app->routesAreCached()) {
         $this->loadCachedRoutes();
     } else {
         $this->loadRoutes();
         $this->app->booted(function () use($router) {
             $router->getRoutes()->refreshNameLookups();
         });
     }
 }
Ejemplo n.º 3
0
 public function getSynchronize(Registrar $router)
 {
     $routes = $router->getRoutes();
     foreach ($routes->getRoutes() as $controller) {
         $actions = $controller->getAction();
         if (!empty($actions['controller'])) {
             $service = $actions['controller'];
             $serviceObject = $this->model->getByAction($service);
             if ($serviceObject->isEmpty()) {
                 $model = new $this->model();
                 $model->action = $service;
                 $model->save();
             }
         }
     }
     return redirect()->back();
 }