laravel

时间:2017-06-14 04:29:30

标签: php laravel-5.4

我有这条路线

Route::name('recruitment.edit.profile')->get('/edit-profile/{id}', 'EmployeeController@showEditProfileForm');

有参数id

我的blade.php中的这段代码

<a href="{{ route('recruitment.edit.profile', $users->id) }}" class="btn btn-success">
  <i class="fa fa-edit m-right-xs"></i> Edit Profile
</a>

但是当我点击指定的链接时,我收到了此网址http://mpci-vo.dev/recruitment/edit-profile?9和一条消息Whoops, looks like something went wrong.

我的问题为什么?之前有9

1 个答案:

答案 0 :(得分:1)

更改route('recruitment.edit.profile', $users->id)

route('recruitment.edit.profile', ['id' => $users->id])

https://laravel.com/docs/5.4/helpers#method-route