0

Hi I'm currently using Laravel-scout search, Is there a way to get and group the results through their duplicates but with large data?

Example i have a list of country

  • New york
  • new York
  • New Y0rk
  • America
  • america
  • AmericA
  • Japan

I want to get the data to become like this

New York => [
   'New york' => [],
   'new York' => [],
   'New Y0rk' => [],
],
America => [
   'America' => [],
   'america' => [],
   'AmericA' => [],
]
hihihihi
  • 68
  • 1
  • 5
  • 29

1 Answers1

1

I think you need to use laravel collection and then apply unique on them. It will help you remove duplicates.

Pls check at this and also this link hope you will get idea.

Muhammad Tariq
  • 175
  • 1
  • 11