Skip to content

Commit 975ae92

Browse files
authored
Update CamundaModel.php
1 parent b375458 commit 975ae92

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Models/CamundaModel.php

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ abstract class CamundaModel
1010
{
1111
protected $client;
1212
public $id;
13+
public $key;
1314

1415
public function __construct($id = null, $attributes = [])
1516
{
@@ -69,6 +70,16 @@ private function buildUrl($url)
6970

7071
private function modelUri()
7172
{
72-
return kebab_case(class_basename($this)) . '/' . $this->id;
73+
if($this->key) {
74+
return kebab_case(class_basename($this)) . '/key/' . $this->key . $this->tenant();
75+
}
76+
else {
77+
return kebab_case(class_basename($this)) . '/' . $this->id;
78+
}
79+
}
80+
81+
protected function tenant()
82+
{
83+
return strlen(config('camunda.api.tenant-id')) ? '/tenant-id/' . config('camunda.api.tenant-id') : '';
7384
}
7485
}

0 commit comments

Comments
 (0)