public function getDelete($id) { $table = null; if (!empty($id)) { $table = Hostpots::whereId($id); $table->delete(); \App\Models\HotspotsGroups::whereHotspotsId($id)->delete(); } return response()->json(array('msg' => 'ok', 'state' => 1, 'data' => null)); }