<?php
namespace App\Services;


use App\User;

class UserService
{
    public static function createConfirmationCode() {
        $unique = false;
        do{
            $confirmation_code = str_random(30);
            if(User::where('confirmation_code', '=', $confirmation_code)->count() == 0){
                $unique = true;
            }
        }
        while(!$unique);
        return $confirmation_code;
    }

}