From e2da8260482d909604afe43934b57705bed6674f Mon Sep 17 00:00:00 2001 From: Stefan Ninic Date: Thu, 21 Mar 2019 14:33:57 +0100 Subject: [PATCH] Updated update() and delete() URL --- src/Utils/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Utils/Model.php b/src/Utils/Model.php index 3bd57bc..4e6420c 100644 --- a/src/Utils/Model.php +++ b/src/Utils/Model.php @@ -70,7 +70,7 @@ public function delete() { return $this->request->handleWithExceptions( function () { - return $this->request->client->delete( "{$this->entity}/{$this->{$this->primaryKey}}" ); + return $this->request->client->delete( "{$this->entity}/" . urlencode( $this->{$this->primaryKey} ) ); } ); } @@ -82,7 +82,7 @@ public function update( $data = [] ) return $this->request->handleWithExceptions( function () use ( $data ) { - $response = $this->request->client->put( "{$this->entity}/{$this->{$this->primaryKey}}", [ + $response = $this->request->client->put( "{$this->entity}/" . urlencode( $this->{$this->primaryKey} ), [ 'json' => $data, ] );