In my table users, Eloquent allows me to use idwith increment:
$table->increments('id');
It's fine. Each new user will receive his id, 1, 2, 3, etc.
However, the identifier must be an automatically assigned string or integer.
I want
- user does not know how many users are there
- user id must be at least 5 digits (47533) or be a unique random string (f8hrcrft13)
How can I achieve this with Eloquent?
What I have found so far:
$table->string('id', 36)->primary()
source
share