group('/pie/{pie_id}', function($app) { $app->group('/cuotas', function($app) { $app->group('/add', function($app) { $app->get('[/]', [Cuotas::class, 'add']); $app->post('[/]', [Cuotas::class, 'doAdd']); }); $app->get('[/]', [Pies::class, 'cuotas']); }); $files = new FilesystemIterator(implode(DIRECTORY_SEPARATOR, [__DIR__, 'pies'])); foreach ($files as $file) { if ($file->isDir()) { continue; } include_once $file->getRealPath(); } });