public function pluck($property)
{
return $this->map(function ($x) use($property) {
if (is_array($x) && isset($x[$property])) {
return $x[$property];
}
if (is_object($x) && isset($x->{$property})) {
return $x->{$property};
}
throw new \Exception('Unable to pluck "' . $property . '"');
});
}