mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-02-16 12:00:50 +01:00
Set admin account ID to always be 1
This commit is contained in:
parent
712101c3f4
commit
3beddca69c
@ -63,6 +63,9 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||||||
|
|
||||||
static::creating(function ($user) {
|
static::creating(function ($user) {
|
||||||
if (config('linkstack.disable_random_user_ids') != 'true') {
|
if (config('linkstack.disable_random_user_ids') != 'true') {
|
||||||
|
if (is_null(User::first())) {
|
||||||
|
$user->id = 1;
|
||||||
|
} else {
|
||||||
$numberOfDigits = config('linkstack.user_id_length') ?? 6;
|
$numberOfDigits = config('linkstack.user_id_length') ?? 6;
|
||||||
|
|
||||||
$minIdValue = 10**($numberOfDigits - 1);
|
$minIdValue = 10**($numberOfDigits - 1);
|
||||||
@ -74,6 +77,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||||||
|
|
||||||
$user->id = $randomId;
|
$user->id = $randomId;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user