title: short_id in sql with Laravel
body: <p>I have a simple table Team: <code>id</code>, <code>short_id</code>, <code>name</code>, <code>championship_id</code></p>
  
  <p>What I need is that for each team <code>short_id</code> increments but only for one championship. When <code>championship_id</code> changes, <code>short_id</code> reset to 0.</p>
  
  <p>I could do it manually, before creating I get <code>max(short_id)</code>, and insert the corresponding value, but I wonder if there is any better solution.</p>
  
  <p>Anyone has an idea?</p>