Wednesday, March 15, 2017

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

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 = new Store_order;
    $order->invoice_id = $signed['invoice_id'];
    $invoice = $order->save()['so_id'];

I used this but it returns null value



via Alen

Advertisement