I'm using laravel and I would like to replicate some data. So I did that :
$id = $request->id;
$data = Setting::find($id);
$newSetting = $data->replicate()->save();
But how to get the id
of $newSetting
? to save that return's only true and I need to return my new id
. I tried with push in place of save but that also return's true.
I checked the documentation but I couldn't find it.
Can somebody help me please ?
Thanks in advance.