Laravel Collection Public API: unique
The unique method in Laravel allows you to get all the unique items in a collection. By default, it performs a case-sensitive check, but you can provide a $key option to further restrict which items are returned. The method returns a new instance of Collection with the unique items. You can also use a callback function as the $key to...