laravel update db code example
Example 1: laravel db::query update
DB::table('user')->where('email', $userEmail)->update(array('member_type' => $plan));
Example 2: TRANSACTON LARAVEL QUERY BUILDER
DB::beginTransaction();
try {
DB::insert(...);
DB::commit();
} catch (\Throwable $e) {
DB::rollback();
throw $e;
}