feat: update student import and graduation workflows
This commit is contained in:
@@ -158,8 +158,12 @@ class StudentSelfServiceController extends Controller
|
||||
|
||||
protected function generateUniqueCode(): string
|
||||
{
|
||||
$characters = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
|
||||
|
||||
do {
|
||||
$code = strtoupper(Str::random(8));
|
||||
$code = collect(range(1, 4))
|
||||
->map(fn () => $characters[random_int(0, strlen($characters) - 1)])
|
||||
->implode('');
|
||||
} while (Student::where('self_service_access_code', $code)->exists());
|
||||
|
||||
return $code;
|
||||
|
||||
Reference in New Issue
Block a user