title: Is there a way to make an autoincrement field that depends a foreign key in laravel migrations
body: <p>I'm using postgres 12 as DB.</p>
  <p>I have an invoice table, with user_id FK, and a date.</p>
  <p>I would like to have a autoincrement field that depends on the FK and the date. For instance</p>
  <pre><code>year: 2019,user_id: 2,incremental: 1
  year: 2019,user_id: 2,incremental: 2
  year: 2020,user_id: 2,incremental: 1 // Because year changes, incremental start to 1 again
  year: 2020,user_id: 2,incremental: 2
  year: 2020,user_id: 2,incremental: 3 
  year: 2020,user_id: 3,incremental: 1 // Because user_id changes, incremental start to 1 again
  year: 2020,user_id: 3,incremental: 2
  year: 2020,user_id: 3,incremental: 3
  year: 2020,user_id: 4,incremental: 4
  </code></pre>
  <p>Is there a way to achieve that directly with migrations, or should I code the logic in the code ?</p>