Create
- a OneToMany relation between User & Username
https://laravel.com/docs/8.x/eloquent-relationships#one-to-many
- a unique constraint in migration for username
https://laravel.com/docs/8.x/migrations#creating-indexes
- and a unique validation
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hi, i am working on users module each user have multiple username and each username must be unique for everyone. i have two table one is users table and second is usernames, in usernames tables i am saving userid and username.
my quest is how to work on each user have multiple usernames validation in request or controller?
Please or to participate in this conversation.