public function destroy(Request $request) { $id = $request->id; if (!$this->repository->exists($id)) { return response(null, 404); } $this->repository->remove($id); $this->repository->flush(); return response(null, 204); }