0

hy i'm using this search, but unfort not working if i will search by both f.name l.name... this is the code

if (Input::has('name'))
        {
            $name = Input::get('name');

            $name = T_entity_details::where('First_Name','LIKE','%'.$name.'%')
            ->where('Last_Name','LIKE','%'.$name.'%','or')
            ->where('Entity_Id','!=',$this->userId)
            ->get(array('Entity_Id'))
            ->toArray();
            $array1 = [];
            foreach ($name as $value) {
                array_push($array1, $value['Entity_Id']);
            }   
        }else{
            $name = T_entity_details::where('Entity_Id','!=',$this->userId)
            ->get(array('Entity_Id'))
            ->toArray();
            $array1 = [];
            foreach ($name as $value) {
                array_push($array1, $value['Entity_Id']);
            }   
        }

ive tryed the lavaret docs, trying with OR but nothing....

Edited by bolfescu

2
Contributors
2
Replies
11
Views
2 Years
Discussion Span
Last Post by bolfescu
0

I'm not failar with that framework but I did notice that on line 6 you include an 'or' in the where condition but not in the one above.
Surely if you need it in the second, its's needed in the first?
Just a thought...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.