public function generate()
    {
        $alphabetLastIndex = strlen($this->alphabet) - 1;
        $code = '';
        for ($i = 0; $i < $this->length; $i++) {
            $code .= $this->alphabet[rand(0, $alphabetLastIndex)];
        }

        return $code;
    }