query the table based on newly created item in laravel code example
Example: laravel update from query
$affected = DB::table('users')
->where('id', 1)
->update(['votes' => 1]);
$affected = DB::table('users')
->where('id', 1)
->update(['votes' => 1]);