Answers for "laravel multiple database connections"

PHP
3

DB::transaction

use Illuminate\Support\Facades\DB;

DB::transaction(function () {
    DB::update('update users set votes = 1');

    DB::delete('delete from posts');
});
Posted by: Guest on December-09-2020
0

laravel 8 app with more than one database

$blogs = DB::connection('mysql2')->table("blog")->get();print_r($blogs);
Posted by: Guest on November-28-2020
0

laravel 8 app with more than one database

$blogs = DB::table("blog")->get();print_r($blogs);
Posted by: Guest on November-28-2020

Code answers related to "laravel multiple database connections"

Browse Popular Code Answers by Language