/** * @inheritdoc */ public function build() { $files = $this->files->files($this->getDirectory()); $configs = []; foreach ($files as $file) { $configs[$this->files->name($file)] = $this->files->getRequire($file); } return $configs; }
private function loadAnnotationRouter(RouteAnnotation $router) { $path = base_path('app/Controller'); $files = new Filesystem(); $controllers = $files->files($path); foreach ($controllers as $ctrl) { preg_match('/app\\/Controller\\/(.*)(Controller)\\.php/', $ctrl, $match); if ($match) { $resouce = "App\\Controller\\" . $match[1]; $router->addResource($resouce); } } }