I have a collection and each item has a featured attribute which is either true or false, so I want to get two variables $featured and $unfeatured.
I can do this:
$featured = $collection.filter(function($item){
return $item->featured;
});
$unfeatured = $collection.filter(function($item){
return !$item->featured;
});
But maybe there's a shorter way?