TRANSACTON LARAVEL QUERY BUILDER
snippet in php

TRANSACTON LARAVEL QUERY BUILDER

user5028

DB::beginTransaction();

try {
    DB::insert(...);    
    DB::commit();
} catch (\Throwable $e) {
    DB::rollback();
    throw $e;
}