Illuminate\Support\Collection::sortByDesc PHP 메소드

sortByDesc() 공개 메소드

Sort the collection in descending order using the given callback.
public sortByDesc ( callable | string $callback, integer $options = SORT_REGULAR ) : static
$callback callable | string
$options integer
리턴 static
    public function sortByDesc($callback, $options = SORT_REGULAR)
    {
        return $this->sortBy($callback, $options, true);
    }

Usage Example

예제 #1
0
 /**
  * @return Collection
  */
 public function getCategories()
 {
     $set = $this->categories->sortByDesc(function (CategoryModel $category) {
         return $category->spent;
     });
     return $set;
 }
All Usage Examples Of Illuminate\Support\Collection::sortByDesc