version('v1', function ($api) { $api->get('version', function () { return response('this is version v1'); }); }); $api->version('v2', function ($api) { $api->get('version', function () { return response('this is version v2'); }); }); /*Route::middleware('auth:api')->get('/user', function (Request $request) { return $request->user(); });*/