title: Prepend an item at the beginning of each element of an Eloquent collection of Laravel
body: <p>I have a collection like this</p>
  
  <pre><code>[
    {
      "objective_id": "26",
      "objective_weight": "50.00",
      "objective_description": "This is first strategic objective",
      "actions": [
      ]
    },
    {
      "objective_id": "27",
      "objective_weight": "12.00",
      "objective_description": "This second strategic objective",
      "actions": [
      ]
    },
  
  ]
  </code></pre>
  
  <p><strong>Now I want to add an item for each element of the collection.</strong> <em>e.g:</em></p>
  
  <pre><code>[
    {
      "foo" : "bar"
      "objective_id": "26",
      "objective_weight": "50.00",
      "objective_description": "This is first strategic objective",
      "actions": [
      ...
      .....
  </code></pre>
  
  <p>I have tried with <code>prepend()</code> method of Eloquent but did not succeed.</p>
  
  <pre><code>$new = $objectives-&gt;map(function($objective) {
      return $objective-&gt;get()-&gt;prepend('hello', 'world');
  });
  
  return $new;
  </code></pre>