public function postSaveaccessmenu(Request $req) { data_menu_user::where('id_level', $req->id_level)->delete(); foreach ($req->id_menu as $id) { data_menu_user::create(['id_menu' => $id, 'id_level' => $req->id_level]); } return redirect()->back()->withNotif(['label' => 'success', 'err' => 'Menu berhasil diperbaharui']); }