12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- use Illuminate\Http\Request;
- Route::prefix('v1')
- ->group(function () {
-
- Route::prefix('admin')
- ->middleware('admin')
- ->group(function () {
- Route::any('/{class}/{action}', function($class, $action) {
- $ctrl = \App::make("\\App\\Http\\Controllers\\Admin\\" . ucfirst($class) . "Controller");
- return \App::call([$ctrl, $action]);
- });
- });
-
- Route::prefix('user')
- ->middleware('user')
- ->group(function () {
- Route::any('/{action}', function($action) {
- $ctrl = \App::make("\\App\\Http\\Controllers\\User\\UserController");
- return \App::call([$ctrl, $action]);
- });
- Route::any('/{class}/{action}', function($class, $action) {
- $ctrl = \App::make("\\App\\Http\\Controllers\\User\\" . ucfirst($class) . "Controller");
- return \App::call([$ctrl, $action]);
- });
- Route::get('server/log/fetch', 'User\\ServerController@logFetch');
- });
-
- Route::prefix('passport')
- ->group(function () {
- Route::any('/{class}/{action}', function($class, $action) {
- $ctrl = \App::make("\\App\\Http\\Controllers\\Passport\\" . ucfirst($class) . "Controller");
- return \App::call([$ctrl, $action]);
- });
- });
-
- Route::prefix('guest')
- ->group(function () {
- Route::any('/{class}/{action}', function($class, $action) {
- $ctrl = \App::make("\\App\\Http\\Controllers\\Guest\\" . ucfirst($class) . "Controller");
- return \App::call([$ctrl, $action]);
- });
- });
-
- Route::prefix('client')
- ->middleware('client')
- ->group(function () {
- Route::any('/{action}', function($action) {
- $ctrl = \App::make("\\App\\Http\\Controllers\\Client\\ClientController");
- return \App::call([$ctrl, $action]);
- });
- Route::any('/{class}/{action}', function($class, $action) {
- $ctrl = \App::make("\\App\\Http\\Controllers\\Client\\" . ucfirst($class) . "Controller");
- return \App::call([$ctrl, $action]);
- });
- });
-
- Route::prefix('server')
- ->group(function () {
- Route::any('/{class}/{action}', function($class, $action) {
- $ctrl = \App::make("\\App\\Http\\Controllers\\Server\\" . ucfirst($class) . "Controller");
- return \App::call([$ctrl, $action]);
- });
- });
- });
|