title: Laravel 5 Merge an array
body: <p>I am trying to merge an array with an input from a form of a random string of numbers</p>
  
  <p>In my form I have</p>
  
  <pre><code>&lt;input type="text" name="purchase_order_number" id="purchase_order_number" value="{{ $purchase_order_number }}" /&gt;
  </code></pre>
  
  <p>And in the controller:</p>
  
  <pre><code>public function store(CandidateRequest $request)
  {
      $candidateInput = Input::get('candidates');
      $purchaseOrderNumber = Input::get('purchase_order_number');
  
      foreach ($candidateInput as $candidate)
      {
  
          $data = array_merge($candidate, [$purchaseOrderNumber]);
  
          $candidate = Candidate::create($data);
  
          dd($data);
  </code></pre>
  
  <p>When I dd($data) it’s getting my purchase_order_number but as seen below but how can I assign it to that row in the table?</p>
  
  <pre><code>array:6 [▼
    "candidate_number" =&gt; "5645"
    "givennames" =&gt; "fgfgf"
    "familyname" =&gt; "dfgfg"
    "dob" =&gt; "01/01/2015"
    "uln" =&gt; "45565445"
    0 =&gt; "5874587"
  ]
  </code></pre>
  
  <p>Many thanks,</p>