Skip to content

Commit d927810

Browse files
authored
[9.x] Make DatabaseManager Macroable (#41868)
1 parent 53b47ad commit d927810

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Illuminate/Database/DatabaseManager.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Support\Arr;
88
use Illuminate\Support\ConfigurationUrlParser;
99
use Illuminate\Support\Str;
10+
use Illuminate\Support\Traits\Macroable;
1011
use InvalidArgumentException;
1112
use PDO;
1213
use RuntimeException;
@@ -16,6 +17,10 @@
1617
*/
1718
class DatabaseManager implements ConnectionResolverInterface
1819
{
20+
use Macroable {
21+
__call as macroCall;
22+
}
23+
1924
/**
2025
* The application instance.
2126
*
@@ -450,6 +455,10 @@ public function setApplication($app)
450455
*/
451456
public function __call($method, $parameters)
452457
{
458+
if (static::hasMacro($method)) {
459+
return $this->macroCall($method, $parameters);
460+
}
461+
453462
return $this->connection()->$method(...$parameters);
454463
}
455464
}

0 commit comments

Comments
 (0)