Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Db transaction laravel

DB::beginTransaction();

try {
    DB::insert(...);    
    DB::commit();
} catch (Exception $e) {
    DB::rollback();
    throw $e;
} catch (Throwable $e) {
    DB::rollback();
    throw $e;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Db #transaction #laravel
ADD COMMENT
Topic
Name
5+5 =