Use POST request for update routes

Posted 5 months ago by xmgravity

I've been using POST request for update routes and it's working just as well, but most people are saying that we should use PUT/PATCH request for update routes.

So let's say the update function is like below:

public function update(Request $request, $id)
{
    $input = $request->all();
    $model = App\Model::find($id);
    $model->update($input);
}

Apart from the semantics, is there any difference at all between using POST and PUT/PATCH for that function?

Please sign in or create an account to participate in this conversation.