I want send $comment->id to Controller updateComment method, and just update one column(comment)
Here's my code, It brings error like this :ErrorException in BoardController.php line 153: Missing argument 1 for App\Http\Controllers\BoardController::updateComment()
View
<form method="post" action="{{route('comment.update', $comment->id)}}">
<input type="hidden" name="_method" value="put">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<textarea name="comment">'+beforeComment+'</textarea>
<input type="submit" value="등록">
</form>
Controller
public function updateComment($id) {
$comment = comment::findOrFail($id);
$body = Request::input('comment');
$comment->update(['comment' => $body]);
return redirect()->back();
}
Route
Route::match(['put', 'patch'], 'comment', ['as'=>'comment.update', 'uses'=>'BoardController@updateComment']);