Hesesses
3 years ago
1461
8
Laravel

Api versioning from v1 to v2

Posted 3 years ago by Hesesses

I’m using 5.3 and have api v1. All my files are under App directory or subdirectories and using App namespace (or App\Http\Controllers for example).

Now I would like to create api v2. For routes I can use another Route::group with prefix v2, but what about the actual files? Should I move all current files under v1 directory and use App\v1 namespace? and new files under v2 directory and use App\v2 namespace?

Or is there a better way to handle this?

Please sign in or create an account to participate in this conversation.