Creating Unique Slugs Based on User Names from Relations

Hi there, I can't help my novice skill and knowledge. I need help, please.

I want to create a slug based on users' full names. I attempted to add the slug field to the 'user' table but discovered that I couldn't have more than one unique index. So, I added the slug field under my 'profile' table, which already has a relational field linked to 'user.id'. In the 'profile' endpoint of the API, how can I filter:

[the current user who will create a 'profile' data: extracting the full name from the 'user' table] is not the same as [any user with the same full names]?

This would enable me to generate an incremental slug based on the creator's full name within the 'profile' database.

Any insights or guidance you can provide would be greatly appreciated. Thank you!

3 replies