Answers for "rollback transaction of attach laravel"

PHP
1

transaction commit rollback in laravel

// try...catch
try {
    // Transaction
    $exception = DB::transaction(function() {

        // Do your SQL here

    });

    if(is_null($exception)) {
        return true;
    } else {
        throw new Exception;
    }

}
catch(Exception $e) {
    return false;
}
Posted by: Guest on October-15-2020

Code answers related to "rollback transaction of attach laravel"

Browse Popular Code Answers by Language