I have a Laravel app with the users
table. I want it (the table) to have username
column instead of name
column, i.e. structure like this:
| id | username | email | password | ...etc. |
| --- | ---------- | ------------------ | ------------- | ------- |
| 1 | Username 1 | [email protected] | xEvehgv#52... | ... |
| 2 | Username 2 | [email protected] | dkjbg#%R!D... | ... |
How can I do this with the help of Laravel 9 without having problems with form data validation and third-party packages? Thank you in advance!
2
Answers
I've just found the answer to my question here. Thank you, everyone, for paying attention to this question.
Note: changing the column
name
in theusers
table is not a good idea because a lot of packages use the default name of the table. Instead, you can add a new column with your customer name.For example:
Otherwise, you can achieve this by going to
database/migrations/_create_users_table.php
And also you have to run migrations
or execute this command: