Skip to content

PATCH method error #172

@niskah-energies

Description

@niskah-energies

Hi,

I'm trying to update a record but I have an error:

{
  "jsonapi": {
    "version": "1.0"
  },
  "errors": [
    {
      "detail": "The PATCH method is not supported for this route. Supported methods: GET, HEAD, POST.",
      "status": "405",
      "title": "Method Not Allowed"
    }
  ]
}

PATCH /api/v1/employees HTTP/1.1
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Host: 127.0.0.1:8000
Connection: close
User-Agent: Paw/3.2.3 (Macintosh; OS X/10.15.4) GCDHTTPRequest
Content-Length: 574

{
   "data":{
      "id":"73e420d6-d5a5-4d08-bc09-267e6ffe2046",    <-- I'm working with uuid as id
      "type":"employees",
      "attributes":{
         "email":"xxx",
         "first_name":"xxx",
         "last_name":"xxx",
         ...
      }
   }
}

route:

JsonApiRoute::server('v1')
    ->prefix('api/v1')
    // ->middleware('auth.okta')
    ->resources(function ($server) {
        ...
        $server->resource('employees', JsonApiController::class);
        ...
    });

Is there any specific config for this method ??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions