laravel dB connection code example
Example 1: DB::transaction
use Illuminate\Support\Facades\DB;
DB::transaction(function () {
DB::update('update users set votes = 1');
DB::delete('delete from posts');
});
Example 2: check which database connect laravel
DB::connection();
Example 3: db import laravel
use Illuminate\Support\Facades\DB;