File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 1.1 .0
1+ 1.2 .0
Original file line number Diff line number Diff 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 *
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments