Esempio n. 1
0
 /**
  * Filter directory contents by type.
  *
  * @param array  $contents
  * @param string $type
  *
  * @return array
  */
 protected function filterContentsByType($contents, $type)
 {
     return Collection::make($contents)->where('type', $type)->pluck('path')->values()->all();
 }
Esempio n. 2
0
 /**
  * Sort the array using the given callback.
  *
  * @param array    $array
  * @param callable $callback
  *
  * @return array
  */
 public static function sort($array, callable $callback)
 {
     return Collection::make($array)->sortBy($callback)->all();
 }