1

I just created a new laravel project where I'll use passport for auth. My users have UUID and installed passport with the UUID option. things I've noticed... passport's id is a primary string of 100 characters

($table->string('id',100)->primary())

user ID is a unsignedBigIncrement , nullable in some cases and index

$table->unsignedBigInteger('user_id')->nullable()->index()

Cliend ID, with the --uuid option is a uuid

$table->uuid('cliend_id')

now my question is, first, has anyone changed the passport tables to uuid('id')->primary() instead of string('id',100)->primary(), and if so, does it affect at all.

Second, I tend to use foreign UUID in most of my tables, so is it worth writing an extra layer of...

$table->foreign('user_id')
->references('id)
->on('users')
->onDelete('cascade')

and...

$table->foreign('client_id')
->references('id)
->on('oauth_clients')
->onDelete('cascade')

just to keep things better organized, or should I just run with it???

0 Answers0