Get the latest record ID - smartest solution

Posted 1 month ago by christopher

I've an ongoing invoice number and i'm currently thinking what could be the smartest way to create the new database entry with the ongoing number.

Do you think i should get the latest record of the database before i save the new model and then add +1 to the newly created record?

Do you think this is the best way to archive this?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.