$collection->prepend()
Prepends an element to the data array
$collection->prepend(string|mixed ...$args): Collection
Parameters
| Name | Type | Default |
|---|---|---|
| ...$args | stringormixed |
no default value |
Return type
This method modifies the existing $collection object it is applied to and returns it again.
Parent class
Examples
$collection->prepend($object);
$collection->prepend('key', $object);