title: How To Use WITH RECURSIVE in Laravel
body: <p>I have a query but i don't know how to run in Laravel </p>
  
  <pre><code>WITH RECURSIVE category_path (id, name, lvl) AS(SELECT id, name, 0 lvl FROM category WHERE parent =1  UNION ALL SELECT c.id, c.name,cp.lvl + 1 FROM category_path AS cp JOIN category AS c ON cp.id = c.parent) SELECT * FROM category_path GROUP BY lvl ORDER BY lvl DESC limit 1
  </code></pre>