Examples of Collection Methods: Unique (2)

Short information about unique

The 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.

Repository: HDInnovations/UNIT3D-Community-Edition (Github)
★ 1366 Created: Dec 2017 Updated: Jul 2021 Laravel version: 8
Files in the example:
- app/Repositories/TaggedUserRepository.php
Repository: agorakit/agorakit (Github)
★ 332 Created: May 2016 Updated: Jun 2021 Laravel version: 8
Files in the example:
- app/Http/Controllers/Admin/GroupAdminsController.php