I have a database with users. One column for the first name, one for the last name. I need to generate the usernames based on the first name and the last name and need to follow this pattern:
first letter of first name only entire last name if the combination is not unique, then add a number at the end of the last name, increment on each new identical occurence.
How can I achieve this with eloquent and Laravel?
Thanks in advance!