db::statement in laravel

56

db::statement in laravel -

DB::statement('DROP TABLE users');
DB::statement('ALTER TABLE projects AUTO_INCREMENT=123');

TRANSACTON LARAVEL QUERY BUILDER -

DB::beginTransaction();

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

Comments

Submit
0 Comments