Support the ongoing development of →
posted 10 years ago
Last updated 2 years ago.

popolla said:

"After saving or creating a new model that uses auto-incrementing IDs, you may retrieve the ID by accessing the object's id attribute".

I'd swear that I actually tried this before and it didn't work. blush Thanks, it does work :)

Last updated 2 years ago.

Model->create() will save it into the table and then update the new saved model variable and then you can use $model->id to get the new incremented id


Submit and redirect?


Sign in to participate in this thread!


Your banner here too?

akalajzi akalajzi Joined 9 Feb 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.