The structure is that:
$data = table->select->join->get();
if(...) {
$data = $data->where();
}
return $data
So the first line returns array of objects. After that there is condition, if it's true, it makes this array like object, like:
{5: {...}, 6: {...}}
I need if = true, then I need response [{}, {}]