I have an Collection of objects - some of which contain empty arrays.
object(Illuminate\Support\Collection)#34225 (1) {
["items":protected]=>
array(0) {
}
}
object(Illuminate\Support\Collection)#34226 (1) {
["items":protected]=>
array(0) {
}
}
object(Illuminate\Support\Collection)#34227 (1) {
["items":protected]=>
array(0) {
}
}
object(Illuminate\Support\Collection)#34228 (1) {
["items":protected]=>
array(0) {
}
}
object(Illuminate\Database\Eloquent\Collection)#23760 (1) {
["items":protected]=>
array(2) {
[0]=>
object(App\Models\File)#23766 (27) {
["primaryKey":protected]=>
string(6) "FileID"
["table":protected]=>
I could use someones help in filtering the Collection of objects so that the objects containing empty arrays are gone/removed.
So that all that remains are the objects with non empty arrays
object(Illuminate\Database\Eloquent\Collection)#23760 (1) {
["items":protected]=>
array(2) {
[0]=>
object(App\Models\File)#23766 (27) {
["primaryKey":protected]=>
string(6) "FileID"
I have populated the collection using
$things = $foos->get($thing->ID, collect());
Any help would be greatly appreciated