JustSteveKing / laravel-envoyer-sdk

A simple to use PHP class to work with the Laravel Envoyer API
MIT License
36 stars 15 forks source link

Removing collaborators doesn't work #13

Open mike503 opened 1 year ago

mike503 commented 1 year ago

When trying to remove a collaborator from a project, it doesn't work, var_dump() on the return value shows this:

object(stdClass)#349 (1) {
  ["message"]=>
  string(80) "The DELETE method is not supported for this route. Supported methods: GET, HEAD."
}

Here's an example snippet:

$r = $envoyer->collaborators->on($project->id)->remove($collab->id);
  var_dump($r);
}
mike503 commented 1 year ago

I can issue manual curl requests with -X DELETE against https://envoyer.io/data/projects/{$project->id}/collaborators/{$collab->id} and it works, so there is something under the hood that isn't sending to the right URI.

if I'm reading it right, on(project) actually crafts a URI based on /api/projects/{$project->id}/path, whereas the base for collaborator removing is /data and not /api.

JustSteveKing commented 1 year ago

It sounds like there could have been API changes - feel free to drop a PR if you like otherwise I will add it to my list of things to do