You need to take a look at advanced wheres.
This should work.
$name = T_entity_details::where('Entity_Id','!=',$this->userId)
->where(function($query)
{
$query->where('First_Name','LIKE','%'.$name.'%')
->orWhere('Last_Name','LIKE','%'.$name.'%')
})
->get(array('Entity_Id'))
->toArray();
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']);
}
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community