0

I want to search within my user records those who have a phone that matches the array that I send, but I would like to use a "like%%", to independently search whether or not the phone has the "+52" example. this is my code that only brings when the phone matches

        $directory= $request->phones;
        $new_arr = array_map('trim', explode(',', $directory));
        $users= USER::whereIn('phone', $new_arr)
          ->distinct()
          ->get();
  • 1
    This is an English forum, so please post in English – Qirel Sep 14 '17 at 17:35
  • 2
    There is a Spanish page: https://es.stackoverflow.com/ – Andreas Sep 14 '17 at 17:36
  • 1
    Ojo. https://es.stackoverflow.com/ (pero tambien fijase esto: https://stackoverflow.com/questions/30761950/laravel-5-like-equivalent-eloquent / https://stackoverflow.com/questions/13386774/using-eloquent-orm-in-laravel-to-perform-search-of-database-using-like – ficuscr Sep 14 '17 at 17:36
  • Dupe of: https://stackoverflow.com/questions/13386774/using-eloquent-orm-in-laravel-to-perform-search-of-database-using-like – ficuscr Sep 14 '17 at 17:43

0 Answers0