maicol07 thank you for your help 🤝
Create/sign + Delete works for me 👍
I still can't figure out the update method.
My task is to add or remove groups for users.
I looked at your examples and wrote the following code, but it doesn't work:
//all good
$user = $this->api->users()->id($id)->request();
$groups = $user->relationships['groups'];
//add new group '3' to already existing
$groups['3'] = [
'type' => 'groups',
'id' => '3'
];
$res = $this->api->users($id)->patch([
'relationships' => [
'groups' => [
$groups
]
]
])->request();
//Throw exception 'Uncaught Maicol07\Flarum\Api\Exceptions\UnauthorizedRequestMethodException: patch in...
///vendor/maicol07/flarum-api-client/src/Fluent.php:162...'
return $res;
Sorry to bother you with a question, but I need your help 🙏