嘿,我正在爲用戶編輯信息編輯頁面,但我收到此錯誤。控制器的App Http Controllers DoctorController缺少參數1 :: edit()
代碼是:
public function edit($id)
{
$doctor = Doctor::find($id);
// Redirect to state list if updating state wasn't existed
if ($doctor == null || count($doctor) == 0) {
return redirect()->intended('doctor/doctorList');
}
return view('doctor/doctorEdit', ['doctor' => $doctor]);
}
我的路線爲:
Route::get('doctor/doctorEdit/edit','[email protected]')->name('doctor.edit');
我的觀點是:
<a href="{{ route('doctor.edit', ['id' => $doctor->id]) }}" class="btn btn-warning col-sm-3 col-xs-5 btn-margin" style="width:100px; margin-left:20px;">
Update
</a>
P租賃讓我知道我做錯了什麼。
@LeonardoCabré仍然給出相同的錯誤 –
您可以切換回原來的路線。你可以傳遞一個數組**或**一個字符串/ int。 –