Skip to content

Commit aabb97f

Browse files
committed
Merge branch 'release/1.2.0'
2 parents 123fe70 + 099797d commit aabb97f

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.2.0

src/Support/Builder.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,19 @@ public function debug(bool $debug = true): self
253253
return $this;
254254
}
255255

256+
/**
257+
* Delete specific instance of class
258+
*
259+
* @throws NoClientException
260+
* @throws TokenException
261+
*/
262+
public function delete(int|string $id): bool
263+
{
264+
// TODO: Consider allowing $id to be null & deleting all
265+
return $this->make([$this->getModel()->getKeyName() => $id])
266+
->delete();
267+
}
268+
256269
/**
257270
* Get Collection of class instances that match query
258271
*

src/Support/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public function delete(): bool
309309

310310
try {
311311
$this->getClient()
312-
->delete($this->getPath());
312+
->delete($this->getPath($this->getKey()));
313313

314314
return true;
315315
} catch (GuzzleException $e) {

0 commit comments

Comments
 (0)