Ejemplo n.º 1
0
 /**
  * Add support for vendor named path overrides.
  *
  * @param  string  $name
  * @return string
  */
 protected function findNamedPathView($name)
 {
     list($namespace, $view) = $this->getNamespaceSegments($name);
     $namespaceOverrides = $this->themeEngine->config('namespace-overrides', []);
     if (in_array($namespace, array_keys($namespaceOverrides))) {
         if ($namespaceOverrides[$namespace] === '') {
             $vendorPath = $this->paths[0];
         } else {
             $vendorPath = $this->paths[0] . DIRECTORY_SEPARATOR . $namespaceOverrides[$namespace];
         }
     }
     if (!isset($vendorPath) || !$this->files->isDirectory($vendorPath)) {
         $vendorPath = $this->paths[0] . '/vendor/' . $namespace;
     }
     $hints = $this->hints[$namespace];
     if (!in_array($vendorPath, $hints) && $this->files->isDirectory($vendorPath)) {
         $this->hints[$namespace] = Arr::prepend($hints, $vendorPath);
     }
     return $this->findInPaths($view, $this->hints[$namespace]);
 }
Ejemplo n.º 2
0
 /**
  * Push an item onto the beginning of an array.
  *
  * @param  array $array
  * @param  mixed $value
  * @param  mixed $key
  * @return array
  */
 function array_prepend($array, $value, $key = null)
 {
     return Arr::prepend($array, $value, $key);
 }
Ejemplo n.º 3
0
 /**
  * Push an item onto the beginning of the collection.
  *
  * @param  mixed  $value
  * @param  mixed  $key
  * @return $this
  */
 public function prepend($value, $key = null)
 {
     $this->items = Arr::prepend($this->items, $value, $key);
     return $this;
 }
Ejemplo n.º 4
0
 public function prependOption($value, $label)
 {
     $this->options = Arr::prepend($this->options, $label, $value);
     return $this;
 }