Update user information

Posted 5 months ago by mDelshad

this is controller for update user information

    public function update($id, array $input)
    {

        $user = $this->getById($id);
        $user->first_name = $input['first_name'];
        $user->last_name = $input['last_name'];
        $user->avatar_type = $input['avatar_type'];
        $user->National_Code = $input['National_Code'];
        $user->phone_number = $input['phone_number'];
        $user->mobile_number = $input['mobile_number'];
        $user->state = $input['state'];
        $user->city = $input['city'];
        $user->address = $input['address'];
        $user->postal_code = $input['postal_code'];

        if ($user->phone_number != $input['phone_number']) {
          $user->phone_verify  = 0;
        }

        if ($user->mobile_number != $input['mobile_number']) {
          $user->mobile_verify  = 0;
        }


        $user->save();
    }


In this code, if the previous number of the user is not equal to the new number, the value of mobile_verify must be 0 , All user information is updated, but this does not change the mobile_verify and phone_verify case

Please sign in or create an account to participate in this conversation.