Here is a request from my Vue component:
 submit() {
      axios
        .put(`/api/posts/${this.slug}`, this.fields, {
          headers: { "content-type": "multipart/form-data" },
        })
        .then((res) => {
          //  some logic
        })
        .catch((error) => {
          // some logic
        });
    }
api.php
Route::group(['prefix' => 'posts', 'middleware' => 'auth:sanctum'], function () {
    Route::put('/{post:slug}', [PostController::class, 'update']);
});
put method doesn't work. I get the following error xhr.js:220          PUT http://127.0.0.1:8000/api/posts/test-title-updated-33 422 (Unprocessable Content) but when I replace put with post everything works as expected. I don't understand why put is not working.
 
    