Illuminate\Support\Collection::prepend PHP Method

prepend() public method

Push an item onto the beginning of the collection.
public prepend ( mixed $value, mixed $key = null )
$value mixed
$key mixed
    public function prepend($value, $key = null)
    {
        $this->items = Arr::prepend($this->items, $value, $key);
        return $this;
    }

Usage Example

コード例 #1
0
 /**
  * Type protection
  *
  * @param mixed $value
  */
 public function prepend($value)
 {
     if ($this->isValidElement($value)) {
         parent::prepend($value);
     } else {
         $this->handleInvalidElement($value);
     }
 }
All Usage Examples Of Illuminate\Support\Collection::prepend