public function sortByDesc($key) { $this->items = $this->items->sortByDesc(function ($item) use($key) { return $item->{$key}; }); return $this; }