I have a multi-tenant DB that I need to manage incrementing invoice numbers per tenant. It's important that i never have any gaps or duplicates for the invoice numbers. I'm using mysql for the database. Is there a best practice to do this using laravel?
What a transaction would look like:
If anything fails in #4, #5 and #6, I need to roll everything back. Also, if another user tries to save an invoice at the same time, I need to make sure they don't duplicate invoice numbers. Need to make sure no gaps or duplicates for any reason for the invoice number.
Recommendation on how to best do this?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community