title: How to use Nested functions substr(), cast() and Max() in query builder in laravel 8?
body: <p>I posted this question yesterday but I think it's unclear so I deleted it and posted it again with more details.
  In my oracle database I have a USERS table with <strong>id_user</strong> defined as <strong>varchar</strong> and this varchar is like this:   '145/1' ...... '145/9' so to add a new user I check the maximum value ('145/9') and add 1 to the second part of id_user (after the slash) so that the id_user is '145/10'.</p>
  <p>The steps are like this:</p>
  <ol>
  <li><strong>First:</strong> I'm using <strong>substr()</strong> to get the second part (after the slash) of all id_user.</li>
  <li><strong>Second:</strong> I use Cast() to convert it to Int.</li>
  <li><strong>Third:</strong> I use Max() to get the maximum value of Int numbers.</li>
  </ol>
  <p>Finally in my laravel code I use the result of this query(the result is 9) and add 1 to it and insert a new user in the <strong>users</strong> table with id_user = '145/10' and so on.
  This query works fine but I need it in the Query Builder so I am trying a lot of queries but they didn't work.(please help me)</p>
  <pre><code>SELECT MAX(CAST(SUBSTR(id_user, INSTR (id_user, '/') + 1) AS INT)) AS Aggregate 
  FROM &quot;users&quot; 
  WHERE &quot;ID_USER&quot; LIKE '145/%';
  </code></pre>