Skip to content
Advertisement

How to get last inserted id in Laravel?

Here is my code

JavaScript

I want to get last inserted id for particular record. I have tried using Eloquent ORM. but it didn’t work.

Any help would be grateful.

Thank You.

Advertisement

Answer

Use insertGetId()

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement