title: Laravel Eloquent condition to fetch hierarchy level
body: <p>Laravel Eloquent condition to fetch hierarchy level.</p>
  <p>I have a table named <code>routes</code> and it is <code>self-referencing</code></p>
  <p>Sample data:</p>
  <pre><code>(PK)                    
  Id  title       route_id
  1   users       null
  2   home        null
  3   foo         1      
  4   bar         3      
  5   hoge        3     
  </code></pre>
  <p>I would want to have a function to get routes according to its hierarchy</p>
  <pre><code>$this-&gt;routes-&gt;getByHierarchyLevel(1);
  // results                    
  Id  title       route_id
  1   users       null
  2   home        null
  
  
  $this-&gt;routes-&gt;getByHierarchyLevel(2);
  // results                    
  Id  title       route_id
  3   foo         1
  
  $this-&gt;routes-&gt;getByHierarchyLevel(3);
  // results                    
  Id  title       route_id
  4   bar         3      
  5   hoge        3
  </code></pre>
  <p><strong>Is there a single chained query builder/eloquent builder possible for this one?</strong></p>
  <p>I already made a custom function of this one but it is a looped query or the other solution is fetch all and filter.</p>