Skip to content

Commit

Permalink
Update InteractsWithAPI.php
Browse files Browse the repository at this point in the history
If the extensing resource does not overrite delete() method, it will fail
  • Loading branch information
cyrillkalita committed Feb 4, 2021
1 parent ec24500 commit 237d831
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Traits/InteractsWithAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,13 @@ public function delete()
if (! $this->hasKey()) {
return;
}
$this->beforeDeleting();

$this->beforeDeleting($query);

$response = $query->delete();

if ($response) {
$this->afterDeleting();
$this->afterDeleting($query);
}

return $response;
Expand Down

0 comments on commit 237d831

Please sign in to comment.