routes Laravel 5.1中未使用的参数
我为mobile编写api,因为我有多个版本,我不想复制粘贴相同的路由,因此我决定这样做:routes Laravel 5.1中未使用的参数,laravel,routing,routes,laravel-5.1,model-binding,Laravel,Routing,Routes,Laravel 5.1,Model Binding,我为mobile编写api,因为我有多个版本,我不想复制粘贴相同的路由,因此我决定这样做: Route::model('callRequestNote', CallRequestNote::class); Route::group([ 'prefix' => 'api/v{version}/mobile', 'where' => ['version' => '[1|2]'], ], function () { Route::delet
Route::model('callRequestNote', CallRequestNote::class);
Route::group([
'prefix' => 'api/v{version}/mobile',
'where' => ['version' => '[1|2]'],
], function () {
Route::delete('/notes/{callRequestNote}', MobileNotesController::class . '@destroy');
// other duplicated routes
});
public function destroy($version, CallRequestNote $callRequestNote)
{
//
}
我只在beforeiddleware
中使用version
参数,因此在控制器中不需要它。我的问题是如何替换这些参数,并将CallRequestNote
作为第一个参数,并去掉$version