From 975ae924682f90d340a4db8dc8c6ba695fbbf5dd Mon Sep 17 00:00:00 2001 From: wertmenschen Date: Wed, 12 Sep 2018 13:48:46 +0200 Subject: [PATCH] Update CamundaModel.php --- src/Models/CamundaModel.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Models/CamundaModel.php b/src/Models/CamundaModel.php index 0ff0e1a..7dfa8d0 100644 --- a/src/Models/CamundaModel.php +++ b/src/Models/CamundaModel.php @@ -10,6 +10,7 @@ abstract class CamundaModel { protected $client; public $id; + public $key; public function __construct($id = null, $attributes = []) { @@ -69,6 +70,16 @@ private function buildUrl($url) private function modelUri() { - return kebab_case(class_basename($this)) . '/' . $this->id; + if($this->key) { + return kebab_case(class_basename($this)) . '/key/' . $this->key . $this->tenant(); + } + else { + return kebab_case(class_basename($this)) . '/' . $this->id; + } + } + + protected function tenant() + { + return strlen(config('camunda.api.tenant-id')) ? '/tenant-id/' . config('camunda.api.tenant-id') : ''; } }