Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
routes Laravel 5.1中未使用的参数_Laravel_Routing_Routes_Laravel 5.1_Model Binding - Fatal编程技术网

routes Laravel 5.1中未使用的参数

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

我为mobile编写api,因为我有多个版本,我不想复制粘贴相同的路由,因此我决定这样做:

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