Instead of using $table->id()
use $table->uxid()
(short for $table->string('id')->primary
)
...
$table->foreignUxidFor(ModelWithUxid::class)
...
use AndreGumieri\LaravelUxid\Database\Eloquent\Concerns\HasUxid;
class User extends Model
{
use HasUxid;
}