//ads:
?>
Eloquent insert id with sequence next value
PHP Snippet 1:
$billing->id = DB::getPdo()->lastInsertId(); // + 1 ?
PHP Snippet 2:
$nextval=DB::select(DB::raw("SELECT nextval('".(new Billing())->getTable()."_id_seq') as seq"))[0]->seq;
$billing = new Billing;
$billing->id = $nextval;
$billing->companyname = $request->companyname;
// ...
$billing->save();