/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if (is_numeric($id)) { $root = Root::where('id', $id)->first(); } else { $root = Root::find($id); } if ($root) { $root->delete(); return response(['message' => "Successfully deleted Root with id {$id}"], 200); } return response(['message' => "Unable to delete Root with id {$id}"], 400); }