Force DB Connection for transactions

This commit is contained in:
David Bomba 2021-12-19 08:54:38 +11:00
parent 0e01b376e4
commit 8bc58a7e2c

View File

@ -110,7 +110,7 @@ class Statement
} }
if ($this->rollback) { if ($this->rollback) {
DB::rollBack(); \DB::connection(config('database.default'))->rollBack();
} }
@ -129,7 +129,8 @@ class Statement
} }
if (\is_null($this->entity)) { if (\is_null($this->entity)) {
DB::beginTransaction(); \DB::connection(config('database.default'))->beginTransaction();
$this->rollback = true; $this->rollback = true;
$invoice = InvoiceFactory::create($this->client->company->id, $this->client->user->id); $invoice = InvoiceFactory::create($this->client->company->id, $this->client->user->id);