Answers for "laravel db:begintrasaction"

SQL
1

db begintransaction laravel

DB::beginTransaction();

try {
    DB::insert(...);
    DB::insert(...);
    DB::insert(...);

    DB::commit();
    // all good
} catch (Exception $e) {
    DB::rollback();
    // something went wrong
}
Posted by: Guest on October-20-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language