How can I encrypt and decrypt an ID
How can I encrypt and decrypt an ID in a URL like http://localhost:4444/admin/users/1/edit for enhanced security, ensuring that the ID is not directly exposed?


5 Replies
Please read this article https://laraveldaily.com/post/laravel-users-table-change-primary-key-id-to-uuid
thank you, I've tried this before, I understand how to use it, only I use the shield plugin, there are lots of ID relationships to users. I'm confused about using it.
It should be possible with Shield if memory serves, it's just changing a few to be more string based opposed to auto-incremementing integers
I can't use the ID because in the shield, the ID must be set as the default, but as far as I know, UUIDs shouldn't be set as default.

You need to use a UUID trait to set a default on the usermodel. i.,e.