Skip to content
Code-Schnipsel Gruppen Projekte
Uuid.php 440 B
Newer Older
  • Learn to ignore specific revisions
  • Patrick Müller's avatar
    Patrick Müller committed
    <?php
    
    namespace QUI\ERP\Coupons\CodeGenerators;
    
    
    use QUI\ERP\Coupons\CodeGeneratorInterface;
    
    Patrick Müller's avatar
    Patrick Müller committed
    use Ramsey\Uuid\Uuid as UuidCreator;
    
    class Uuid implements CodeGeneratorInterface
    {
        /**
         * Generate a random, unique Invite code
         *
         * @param string $prefix (optional)
         * @return string
         */
    
        public static function generate($prefix = ''): string
    
    Patrick Müller's avatar
    Patrick Müller committed
        {
    
            return $prefix . UuidCreator::uuid1()->toString();
    
    Patrick Müller's avatar
    Patrick Müller committed
        }
    }