1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 23:54:03 +00:00

make int ranges configurable

This commit is contained in:
Samuel Štancl 2025-01-21 14:16:52 +01:00
parent 4ddc2be569
commit 8f7b8e971a

View file

@ -9,13 +9,14 @@ use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator;
/**
* Generates a cryptographically secure random integer for the tenant key.
*
* The integer is generated in range (0, PHP_INT_MAX).
*/
class RandomIntGenerator implements UniqueIdentifierGenerator
{
public static int $min = 0;
public static int $max = PHP_INT_MAX;
public static function generate(Model $model): string|int
{
return random_int(0, PHP_INT_MAX);
return random_int(static::$min, static::$max);
}
}