The
Read more in the official Laravel docs.
unique method returns all of the unique items in the collection. The returned collection keeps the original array keys, so in the following example we will use the values method to reset the keys to consecutively numbered indexes.Read more in the official Laravel docs.