app/User.php
public function setPassword(string $password): User
    {
        DB::table('user')
            ->where('user_id', '=', $this->user_id)
            ->update([
                'password' => password_hash($password, PASSWORD_DEFAULT),
            ]);

        return $this;
    }
public function setPassword(string $password): User
    {
        DB::table('user')
            ->where('user_id', '=', $this->user_id)
            ->update([
                'password' => password_hash($password, PASSWORD_DEFAULT),
            ]);

        return $this;
    }
public function setPassword ( string $ password ) : User { DB :: table ( 'user' ) -> where ( 'user_id' , '=' , $ this -> user_id ) -> update ( [ 'password' => password_hash ( $ password , PASSWORD_DEFAULT ) , ] ) ; return $ this ; }
Set the password of this user.

@param string $password

@return User
Set the password of this user .