title: Laravel Multi Insertion and its relationship
body: <p>I know about Model::insert() But how about its associated relationship?</p>
  
  <p>We know we can have 100 question after form submit but corresponding question have around 4 answer (For multiple choice questions)</p>
  
  <p>Our question data look like this</p>
  
  <pre><code>$question = [
   '1' =&gt;[
          'name'='Who is first president of America'?
          ...
      ]
      ...
   '100' =&gt;
      'name' = 'When did Christopher Colombus discovered America'
      ....
  
      ...
  ]
  
  $answers = [
      '1'=&gt;
          [
              '1' =&gt; 'Wilston Churcil',
              '2' =&gt; 'George Washinton'
              ....
          ]
          ...
      ...
  ]
  
  $correct_answer = [
      '1'=&gt;['2']
      ...
  ]
  </code></pre>
  
  <p>Relationship</p>
  
  <ul>
  <li>Question has many Answers</li>
  <li>Question has many Correct Answers</li>
  </ul>
  
  <p>We are trying to upload many questions at once </p>
  
  <p>We can clearly see if we don't go for laravel create otherwise we will run n+1 problems and for 100 question we may probably need 100 + 400 + 100 queries which is extremely inefficient?</p>
  
  <p>If Question::insert() has returned id of inserted question then it would be easy but it just return Boolean ..</p>
  
  <p>Is there anyway to solve such issue without using n+1 problem.</p>
  
  <p>I tried using n+1 and background job but it is really extremely slow :(</p>
  
  <p>Any solution and hacks would be ok :(</p>