Example of Collection Methods: Unique in HDInnovations/UNIT3D-Community-Edition

File app/Repositories/TaggedUserRepository.php (link to Github)
use App\Notifications\NewCommentTag;

class TaggedUserRepository
{
    //
    public function messageCommentUsers($type, $users, $sender, $alias, Comment $comment)
    {
        //
        if (\is_iterable($users)) {
            $users = \is_array($users) ? \collect($users)->unique() : $users->unique();

            foreach ($users as $user) {
                if ($this->validate($user) && $user->acceptsNotification($sender, $user, 'mention', 'show_mention_'.$type.'_comment')) {
                    $user->notify(new NewCommentTag($type, $alias, $comment));
                }
            }

            return true;
        }
        //
    }
    //
}