【发布时间】:2015-10-27 12:49:07
【问题描述】:
我正在尝试在 Laravel 的路由中处理我的 API 调用的基本验证。这是我想要实现的目标:
Route::group(['prefix' => 'api/v1/properties/'], function () {
Route::get('purchased', 'PropertiesController@getPropertyByProgressStatus', function () {
//pass variable x = 1 to the controller
});
Route::get('waiting', 'PropertiesController@getPropertyByProgressStatus', function () {
//pass variable x = 2 to the controller
});
});
长话短说,取决于 api/v1/properties/ 之后的 URI 段,我想将不同的参数传递给控制器。有没有办法做到这一点?
【问题讨论】:
标签: php laravel-5 laravel-routing