How to get last inserted id through save() method in laravel

后端 未结 6 1772
醉酒成梦
醉酒成梦 2021-01-22 03:37

I know to get the last id I can use insertGetId() but I want to know how can I get the last inserted id through save() method.

order =          


        
6条回答
  •  天命终不由人
    2021-01-22 04:02

    $ObjTable->nane = $name;
    $ObjTable->save();
    echo $ObjTable->id;
    

    this will be display last inserted id.

提交回复
热议问题