title: Convert Raw SQL Query to Laravel Eloquent
body: <p>My project is a content management system &amp; a new version of it will be integrated in a Laravel framework; and there are lots of huge SQL queries which needs to be converted into eloquent syntax.</p>
  
  <p>I found the following <a href="https://laravel-news.com/convert-sql-laravel-builder-orator" rel="nofollow noreferrer">tool</a> to convert my already written queries into eloquent syntax, but it does not work.</p>
  
  <p>Could anyone guide me to convert my queries or help me find a tool that could do the job?</p>
  
  <p>Please find below a sample of my queries (note that most of my queries look similar):</p>
  
  <pre><code>SELECT id, name, code,
         ( SELECT price FROM productprice WHERE id = p.id ) AS price,
         ( SELECT image FROM productpictures WHERE id = p.id LIMIT 1 ) 
  AS image
  FROM product p 
  WHERE categoryid = 1
  </code></pre>
  
  <p>Thank you.</p>