Search
 
SCRIPT & CODE EXAMPLE
 

PHP

DB::beginTransaction()

/* method provided by the DB facade: */
use IlluminateSupportFacadesDB;
 
DB::beginTransaction();
//You can rollback the transaction via the rollBack method:
DB::rollBack();
//Lastly, you can commit a transaction via the commit method:
DB::commit();
//EXP : 
// Open a try/catch block
try {
    // Begin a transaction
    DB::beginTransaction();
    // Do something and save to the db...
  
    // Commit the transaction
    DB::commit();
} catch (Exception $e) {
    // An error occured; cancel the transaction...
    DB::rollback();
    // and throw the error again.
    throw $e;
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel login by id 
Php :: how to display list of all pages in wordpress 
Php :: laravel migration add column after 
Php :: Laravel 8 query builder, Inner Join Clause 
Php :: laravel carbon first day of month 
Php :: composer create-project laravel/laravel --prefer-dist laravel-bootstrap 
Php :: spatie media library retrieve media from url 
Php :: get ip in laravel 
Php :: laravel get input from request 
Php :: php base64 to image 
Php :: php artisan services 
Php :: convert matrix row to column php 
Php :: asset not working in laravel 
Php :: cmd run powershell command 
Php :: laravel module remove 
Php :: php artisan cache 
Php :: centos :Install or enable PHP gd extension. 
Php :: update json file php 
Php :: Get color code from string 
Php :: storePublicly laravel with name 
Php :: get first element of array php 
Php :: php append line to file 
Php :: how to count no of words in a string in php without using string functions 
Php :: diff for seconds laravel carbon 
Php :: php parse url get path 
Php :: array should not be empty php 
Php :: running laravel project in mobile phone 
Php :: laravel orderby with relation 
Php :: Auth::routes(); why display error in route laravel 8 
Php :: check file size validation laravel 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =