public function destroy($id) { $deleted = $this->repository->delete($id); if ($deleted) { // Deleted, return 204 No Content return $this->response->noContent(); } else { // Failed, throw exception throw new DeleteResourceFailedException(); } }