For my users
table, Eloquent lets me use an id
with increment
:
$table->increments('id');
That is just fine. Every new user will get their id
, 1, 2, 3, etc.
However the id should be an automatically assigned string or integer.
I want
- the user not to know how many users there are
- the user id to be like at least 5 digits (47533) or be a unique random string (f8hrcrft13)
How can I achieve this using Eloquent?
What I found so far:
$table->string('id', 36)->primary()