Skip to content

Commit d16fea6

Browse files
author
Andrey Helldar
committed
Return usingConnection method for Laravel 6
1 parent e5a95a0 commit d16fea6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Support/Migrator.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ class Migrator extends BaseMigrator
1414
use Infoable;
1515
use Versionable;
1616

17+
public function usingConnection($name, callable $callback)
18+
{
19+
$prev = $this->resolver->getDefaultConnection();
20+
21+
$this->setConnection($name);
22+
23+
return tap($callback(), function () use ($prev) {
24+
$this->setConnection($prev);
25+
});
26+
}
27+
1728
/**
1829
* Run "up" a migration instance.
1930
*

0 commit comments

Comments
 (0)