<?php

Route::any('/{version}/{controller}/{action}', function ($version, $controller, $action) {
    $namespace = 'App\Http\Controllers\Api\\'.ucfirst($version).'\\';

    $className = $namespace . ucfirst($controller . "Controller");
    $tempObj = new $className();
    return call_user_func(array($tempObj, $action));
});
