I'm using Lumen for my project, currently the way I version my API is through prefixing and using a specific corresponding controller like so:
$api->get('/v1/users', 'App\Api\V1\Controllers\UserController@show');
$api->get('/v2/users', 'App\Api\V2\Controllers\UserController@show');
I want to change this, such that I take an argument from the user and use a controller based on that parameter.
This Route:
$api->get('/v{api_version}/users'...
Should use this controller:
'App\Api\V{api_version}\Controllers\UserController@show'
I'm currently using Dingo along side Lumen, is there anyway to do this with either Lumen or Dingo?