Skip to content

Instantly share code, notes, and snippets.

@donamkhanh
Created December 27, 2016 08:02
Show Gist options
  • Save donamkhanh/f1c224929ce2c39288176544b41ceada to your computer and use it in GitHub Desktop.
Save donamkhanh/f1c224929ce2c39288176544b41ceada to your computer and use it in GitHub Desktop.
Logical division demo for API versioning
<?php
Route::group(['prefix' => 'v1.1'], function () {
Route::get('users', function () {
// Matches The "/v1.1/users" URL
});
});
Route::group(['prefix' => 'v2.0'], function () {
Route::get('users', function () {
// Matches The "/v2.0/users" URL
});
});
Route::group(['prefix' => 'v2.1'], function () {
// Matches The "/v2.1/foo" URL
Route::get('foo', 'Photos\V2.1\AdminController@method');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment