Created
December 27, 2016 08:02
-
-
Save donamkhanh/f1c224929ce2c39288176544b41ceada to your computer and use it in GitHub Desktop.
Logical division demo for API versioning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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