v2board/app/Http/Routes/V1/ServerRoute.php

20 lines
515 B
PHP
Raw Normal View History

2020-02-01 20:51:45 +08:00
<?php
2023-06-12 02:32:49 +08:00
namespace App\Http\Routes\V1;
2020-02-01 20:51:45 +08:00
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) {
2023-06-12 02:32:49 +08:00
$ctrl = \App::make("\\App\\Http\\Controllers\\V1\\Server\\" . ucfirst($class) . "Controller");
2020-02-01 20:51:45 +08:00
return \App::call([$ctrl, $action]);
});
});
}
}