private function dopublish(Request $request, $value) { $product = News::whereIn('id', $request->ids)->update(array('is_published' => $value)); $response = ['model_type' => 'News', 'ids' => $request->ids, 'action_type' => $value == 1 ? "Publish" : "Unpublish"]; return json_encode($response); }