我想使用路由助手传递两个参数
一个是线程ID,另一个是线程ID,所以我想同时传递
index.blade.php
@foreach($works as $work)
<tr>
<td><a href="{{route('work.edit', ['id' => $work->id], ['project' => $param->id])}}">{{$work->input_person}}</a></td>
web.php
Route::get('/work/edit/{id}/{project}', 'WorkController@edit')->name('work.edit');
偶然地,错误显示如下
Missing required parameters for [Route: work.edit] [URI: work/edit/{id}/{project}].
我不知道该怎么做
答案 0 :(得分:2)
以相同数组传递它。
<a href="{{ route('work.edit', ['id' => $work->id,'project' => $param->id])}}">
答案 1 :(得分:1)
尝试一下:
route('work.edit', ['id' => $work->id, 'project' => $param->id])