/** * 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(); }
/** * Gather the middleware for the given route. * * @param \Illuminate\Routing\Route $route * @return array */ public function gatherRouteMiddlewares(Route $route) { $return = Collection::make($route->middleware())->map(function ($m) { return Collection::make(array_get($this->middleware, $m, $m)); }); //echo '<pre>'; //var_dump($return); return $return->collapse()->all(); }