/** * Mass delete function from index page * @param Request $request * * @return mixed */ public function massDelete(Request $request) { if ($request->get('toDelete') != 'mass') { $toDelete = json_decode($request->get('toDelete')); News::destroy($toDelete); } else { News::whereNotNull('id')->delete(); } return redirect()->route('admin.news.index'); }