Laravel - 访问RouteServiceProvider.php中的中间件

I need to separate the backend and frontend routes. To do so I created two different files in outes directory for backend and frontend. In the RouteServiceProvider.php I want to know who the current user is in order to load its routes. I tried this

public function map()
{
    $this->mapApiRoutes();

    $this->mapWebRoutes();

    //
}

protected function mapWebRoutes()
{

    Route::middleware('auth')
         ->namespace($this->namespace)
         ->group(base_path('routes/backend.php'));
}

To load the route for middleware auth but it is not working. How can I do that?