rappasoft / laravel-authentication-log

Log user authentication details and send new device notifications.
MIT License
783 stars 95 forks source link

Support for UUID #34

Closed simtabi closed 2 years ago

simtabi commented 2 years ago

Doesn't seem to work with UUID strings.

rappasoft commented 2 years ago

Can you be more specific?

simtabi commented 2 years ago

We have projects that we use UUID string instead of the incrementing int ID's. But your package doesn't support string ID's.

This: $table->morphs('authenticatable'); should be $table->uuidMorphs('authenticatable');

This will support for for both int and string id's

rappasoft commented 2 years ago

I see. I'm open to pull requests if you have time.

rappasoft commented 2 years ago

Honestly the easiest solution I think is to publish the migrations:

php artisan vendor:publish --provider="Rappasoft\LaravelAuthenticationLog\LaravelAuthenticationLogServiceProvider" --tag="authentication-log-migrations"

And update the morphs to uuidMorphs before you migrate. Would that fix your problem?

simtabi commented 2 years ago

Honestly the easiest solution I think is to publish the migrations:

php artisan vendor:publish --provider="Rappasoft\LaravelAuthenticationLog\LaravelAuthenticationLogServiceProvider" --tag="authentication-log-migrations"

And update the morphs to uuidMorphs before you migrate. Would that fix your problem?

thank you. yes that would. I ended up forking your repo and added more functionalities to it. thanks for sharing your code!

rappasoft commented 2 years ago

Sounds good. I hope that solves it, I'm going to close the PR since it wouldn't work for everyone.

BRGustavoRibeiro commented 8 months ago

Hi, guys! I'm having a problem with this one. I've published the migrations and changed it to support UUID, but it is throwing me this error:

image

Any ideas? Thx