You can pass the route parameters as second argument to route()
:
(您可以将route参数作为第二个参数传递给route()
:)
return Redirect::route('regions', [$id])->with('message', 'State saved correctly!!!');
If it's only one you also don't need to write it as array:
(如果只有一个,则也不需要将其写为数组:)
return Redirect::route('regions', $id)->with('message', 'State saved correctly!!!');
In case your route has more parameters, or if it has only one, but you want to clearly specify which parameter has each value (for readability purposes), you can always do this:
(如果您的路由有更多参数,或者只有一个参数,但是您想清楚地指定哪个参数具有每个值(出于可读性目的),则始终可以执行以下操作:)
return Redirect::route('regions', ['id'=>$id,'OTHER_PARAM'=>'XXX',...])->with('message', 'State saved correctly!!!');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…