Hindari penyisipan data jika terjadi kesalahan di Laravel

try {
        //start the transaction
        DB::beginTransaction();

        DB::table('XYZ')->update(['abc'=>'ABC']);
        DB::table('EG')->delete();

        //commit the transaction
        DB::commit();
} catch (\Exception $e) {
        DB::rollBack();
        return response;
}
Isaac