vendredi 13 juillet 2018

Creating ID Based on Year and Last Incremented Number Used for Year

I'm using Laravel for a project of mine and was curious about how I might go creating a label for a record (in essence, an ID) in a format such as this.

2018-0001
2018-0002
2018-0003
2019-0001

I've seen it done before and maybe it's possible I'm using the wrong search parameters but I'm not coming up with many results. But I would like to be able to base the year off of a field called dateFiled, so when someone creates a record that was filed in 2020 and it is the first of that year, the resulting label is 2020-0001.

I'd appreciate any help, or any leads to help with this. Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire