Tag: 雄辩

laravel updateOrCreate方法

我在我的方法中有以下代码,我通过ajax发送到控制器方法: $newUser = \App\UserInfo::updateOrCreate([ ‘user_id’ => Auth::user()->id, ‘about’ => $request->get(‘about’), ‘sec_email’ => $request->get(‘sec_email’), ‘gender’ => $request->get(“gender”), ‘country’ => $request->get(‘country’), ‘dob’ => $request->get(‘dob’), ‘address’ => $request->get(‘address’), ‘mobile’ => $request->get(‘cell_no’) ]); dd($request->all())给了我: array:8 [ “_token” => “fHeEPfTvgMD3FpIBmmc6DmKXFaiuWKZEiOhg6twQ” “about” => “Some about me.” “sec_email” => “example@gmail.com” “country” => “Priority highest” “gender” => “male” “dob” => “12/12/1990” “address” => […]