group([ 'prefix' => 'server', 'middleware' => 'server' ], function ($router) { $router->any('/{class}/{action}', function($class, $action) { $controllerClass = "\\App\\Http\\Controllers\\V1\\Server\\" . ucfirst($class) . "Controller"; if(!(class_exists($controllerClass) && method_exists($controllerClass, $action))){ throw new ApiException(404,'Not Found'); }; $ctrl = \App::make($controllerClass); return \App::call([$ctrl, $action]); }); }); } }