mapApiRoutes(); $this->mapWebRoutes(); //后台路由 $this->mapAdminRoutes(); $this->mapTeacherRoutes(); $this->mapWeChatRoutes(); } public function mapAdminRoutes() { Route::prefix('admin') ->middleware('web') ->namespace($this->namespace. '\Admin') ->group(base_path('routes/admin.php')); } public function mapTeacherRoutes() { Route::prefix('teacher') ->middleware('web') ->namespace($this->namespace. '\Teacher') ->group(base_path('routes/teacher.php')); } public function mapWeChatRoutes() { Route::prefix('wechat') ->middleware('web') ->namespace($this->wechat_namespace) ->group(base_path('routes/wechat.php')); } /** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. * * @return void */ protected function mapWebRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->api_namespace) ->group(base_path('routes/api.php')); } }