public function output($amount = 1)
    {
        $collection = [];

        for ($i = 1; $i <= $amount; $i++) {
            $random = $this->generate();

            while (!$this->validate($collection, $random)) {
                $random = $this->generate();
            }

            array_push($collection, $random);
        }

        return $collection;
    }
public function output($amount = 1)
    {
        $collection = [];

        for ($i = 1; $i <= $amount; $i++) {
            $random = $this->generate();

            while (!$this->validate($collection, $random)) {
                $random = $this->generate();
            }

            array_push($collection, $random);
        }

        return $collection;
    }
public function output ( $ amount = 1 ) { $ collection = [ ] ; for ( $ i = 1 ; $ i <= $ amount ; $ i ++ ) { $ random = $ this -> generate ( ) ; while ( ! $ this -> validate ( $ collection , $ random ) ) { $ random = $ this -> generate ( ) ; } array_push ( $ collection , $ random ) ; } return $ collection ; }
Generates promocodes as many as you wish.

@param int $amount

@return array
Generates promocodes as many as you wish .