title: Laravel with(): What this method does?
body: <p>I am new on Laravel and working on small application. In Laravel tutorials, I have read the <strong>with()</strong> method of Eloquent model but not able to understand it's working clearly.  </p>
  
  <p>I have seen many tutorials to clear this concept. Somebody post small understanding and somebody post deep understanding of <strong>with()</strong> method. At one place someone trying to clear this below example:  </p>
  
  <pre><code>$collection = Model_1::where("year", 2016)-&gt;with(array("Model_2"=&gt;function($q){$q-&gt;with("Model_3","Model_4");}))-&gt;with("Model_5","Model_6")-&gt;get()-&gt;toArray();  
  </code></pre>
  
  <p>Overall, still I am not able to understand the concept of this method. Please anyone can clear me the concept of with() method and explain the working of above statement? Thanks in Advance.</p>