v2board/app/Http/Routes/ServerRoute.php
2020-02-01 20:51:45 +08:00

20 lines
508 B
PHP

<?php
namespace App\Http\Routes;
use Illuminate\Contracts\Routing\Registrar;
class ServerRoute
{
public function map(Registrar $router)
{
$router->group([
'prefix' => 'server'
], function ($router) {
$router->any('/{class}/{action}', function($class, $action) {
$ctrl = \App::make("\\App\\Http\\Controllers\\Server\\" . ucfirst($class) . "Controller");
return \App::call([$ctrl, $action]);
});
});
}
}