michaeldyrynda / laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models
MIT License
451 stars 47 forks source link

is it possible to generate uuid for existing db entry? #111

Closed Sjos12 closed 2 years ago

Sjos12 commented 2 years ago

I have some users on my live server and only recently used this package to add a UUID to the user model. Is it possible to still generate a uuid for the users that were already registered before I added UUIDs to the site? Thanks!

michaeldyrynda commented 2 years ago

The package functionality will only generate a new UUID for a (new) model’s creating event.

If you need to backfill existing records, you’d need to do so yourself either manually with tinker, via a one-time command, or inside of a database migration.