0
每一個崗位列表中有Edit
鏈接Laravel編輯鏈接不起作用
<a href="{{ URL::to('dashboard/post/' . $post->id . '/edit') }}" class="btn btn-default btn-edit-post">Edit</a>
航線PostsController
public function edit($id)
{
$post = Post::findOrFail($id);
return view('dashboard.edit', compact('post'));
}
public function update($id, PostRequest $request)
{
$post = Post::findOrFail($id);
$post->update($request->all());
return redirect ('dashboard');
}
但碰杯編輯按鈕
Route::get('dashboard/posts/{id}/edit', '[email protected]');
Route::put('dashboard/posts/{id}', '[email protected]');
方法我收到一個錯誤
NotFoundHttpException在RouteCollection.php線161:
有什麼不對?如何解決它?
哎喲!非常感謝! – Heidel