One way I solved this is by editing the app/Providers/RouteServiceProvider.php
and having another route files for other group middleware ie api
public function map(Router $router)
{
$this->mapWebRoutes($router);
$this->mapApiRoutes($router);
}
protected function mapWebRoutes(Router $router)
{
$router->group([
'namespace' => $this->namespace, 'middleware' => 'web',
], function ($router) {
require app_path('Http/routes.php');
});
}
protected function mapApiRoutes(Router $router)
{
$router->group([
'namespace' => $this->namespace, 'middleware' => 'api',
], function ($router) {
require app_path('Http/routes-api.php');
});
}
To verify the result, run php artisan route:list
on terminal and check the route middleware.
For instance:

Now I have some route without web middleware which is defined in different file which later called in RouteServiceProvider
OR
If you prefer the old features, you can have something like this:
public function map(Router $router)
{
$this->mapWebRoutes($router);
$this->mapGeneralRoutes($router);
}
protected function mapGeneralRoutes(Router $router)
{
$router->group(['namespace' => $this->namespace], function ($router) {
require app_path('Http/routes-general.php');
});
}
Then, in routes-general.php
you can have multiple middleware groups for different set of routes just like before