1
require dirname(dirname(__DIR__)) . '/vendor/autoload.php';
require dirname(__DIR__) . '/config.php';
use Illuminate\Database\Capsule\Manager as DB;
$dbc = new DB;
$dbc->addConnection(array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => DB_NAME,
'username' => DB_USER,
'password' => DB_PASSWORD,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => ''
));
$dbc->setAsGlobal();
$dbc->bootEloquent();
$ dbc-> beginTransaction();運行laravel照亮laravel外的數據庫事務
給了我這個錯誤,
PHP Fatal error: Call to undefined method Illuminate\\Database\\Capsule\\Manager::beginTransaction()
誰能給我提供一些幫助,如何使用laravel外膠囊和數據庫事務。我無法找到任何暗示此功能無效的內容?