Danabek Duisekov :
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 [{}, {}]
TsaiKoga :
You can use collection method values() to make it without keys:
if(...) {
$data = $data->where()->values()->all();
}