title: Laravel 5.2 insert an array at once and update if exists
body: <p>I'm trying to insert an array at once and i also want to update if exists. But i get this error.</p>
  
  <pre><code>$jobs = array();
  
  //Iterate over the extracted links and display their URLs
  foreach ($links as $link){
  
          $data = get_job_info($link);
  
          $jobs[] = [
              'title' =&gt; $data['title'],
              'full_desc' =&gt; $data['desc'],
              'to_date' =&gt; $data['date'],
              'ad_type' =&gt; 'fb'
          ];
  
      }
  }
  
  DB::table('customer_position')-&gt;insert($jobs);
  </code></pre>