You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When multiple connections are specified in $connectionsToTransact (default value: [null]), any callback functions specified in DB::afterCommit() will not be executed.
Steps To Reproduce
<?phpnamespaceTests\Feature;
useIlluminate\Foundation\Testing\RefreshDatabase;
useIlluminate\Support\Facades\DB;
useTests\TestCase;
class ExampleTest extends TestCase
{
protected$connectionsToTransact = [null, 'sqlite'];
use RefreshDatabase;
publicfunctiontestExample(): void
{
$executed = false;
DB::transaction(function () use (&$executed) {
DB::afterCommit(function () use (&$executed) {
$executed = true;
});
});
$this->assertTrue($executed);
}
}