我试图根据电子邮件而不是ID更新用户,有没有一种方法可以在不使用原始查询的情况下完成此操作。
当前的错误
{"error":{"type":"ErrorException","message":"Creating default object from empty value","file":"C:\wamp\www\celeb-jim\app\controllers\SignupController.php","line":189}}
我的代码
public function changeAccountStatus ($plan, $userEmail ){
$UpdateDetails = User::where('email', '=', $userEmail)->first();
$UpdateDetails->member_type = $plan;
$UpdateDetails->save();
}