register step
This commit is contained in:
parent
1ada368ed4
commit
f06d2d15a5
50 changed files with 748 additions and 276 deletions
21
app/Services/UserService.php
Normal file
21
app/Services/UserService.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue