app/User.php
public function setRealName($real_name): User
    {
        if ($this->real_name !== $real_name) {
            $this->real_name = $real_name;

            DB::table('user')
                ->where('user_id', '=', $this->user_id)
                ->update([
                    'real_name' => $real_name,
                ]);
        }

        return $this;
    }
public function setRealName($real_name): User
    {
        if ($this->real_name !== $real_name) {
            $this->real_name = $real_name;

            DB::table('user')
                ->where('user_id', '=', $this->user_id)
                ->update([
                    'real_name' => $real_name,
                ]);
        }

        return $this;
    }
public function setRealName ( $ real_name ) : User { if ( $ this -> real_name !== $ real_name ) { $ this -> real_name = $ real_name ; DB :: table ( 'user' ) -> where ( 'user_id' , '=' , $ this -> user_id ) -> update ( [ 'real_name' => $ real_name , ] ) ; } return $ this ; }
Set the real name of this user.

@param string $real_name

@return User
Set the real name of this user .