When I put unique() on column in laravel migration, I don’t need to put index() anymore right? Unique already creates an index for fast search?
unique() alone is enough. It will create a
UNIQUE index on the table which basically is the same as a “normal”
INDEX but also enforces the constraint that there can be no two rows with the same value.
So in terms of performance
UNIQUE should be at least the same if not even faster. No need to add an additional index.
This question has a nice answer comparing the different indexes of MySQL.
No , You do not need to put index() anymore.