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

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

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

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

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

@param string $email

@return User
Set the email address of this user .