This error would suggest that User::where('email', '=', $userEmail)->first()
is returning null, rather than a problem with updating your model.
Check that you actually have a User before attempting to change properties on it, or use the firstOrFail()
method.
$UpdateDetails = User::where('email', $userEmail)->first();
if (is_null($UpdateDetails)) {
return false;
}
or using the firstOrFail()
method, theres no need to check if the user is null because this throws an exception (ModelNotFoundException
) when a model is not found, which you can catch using App::error()
http://laravel.com/docs/4.2/errors#handling-errors
$UpdateDetails = User::where('email', $userEmail)->firstOrFail();