group('/proyectos', function($app) { $folder = implode(DIRECTORY_SEPARATOR, [__DIR__, 'proyectos']); if (file_exists($folder)) { $files = new FilesystemIterator($folder); foreach ($files as $file) { if ($file->isDir()) { continue; } include_once $file->getRealPath(); } } $app->get('/unidades[/]', [Proyectos::class, 'unidades']); $app->get('[/]', Proyectos::class); })->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class)); $app->group('/proyecto/{proyecto_id}', function($app) { $app->get('[/]', [Proyectos::class, 'show']); })->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class));