Skip to content

Commit 63d87d7

Browse files
committed
revert facade change
1 parent d37abcf commit 63d87d7

4 files changed

Lines changed: 8 additions & 12 deletions

File tree

src/Illuminate/Database/DatabaseServiceProvider.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ protected function registerConnectionServices()
6565
$this->app->bind('db.connection', function ($app) {
6666
return $app['db']->connection();
6767
});
68-
69-
$this->app->bind('db.schema', function ($app) {
70-
return $app['db']->connection()->getSchemaBuilder();
71-
});
7268
}
7369

7470
/**

src/Illuminate/Support/Facades/Facade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,15 @@ protected static function getFacadeAccessor()
159159
/**
160160
* Resolve the facade root instance from the container.
161161
*
162-
* @param string $name
162+
* @param object|string $name
163163
* @return mixed
164164
*/
165165
protected static function resolveFacadeInstance($name)
166166
{
167+
if (is_object($name)) {
168+
return $name;
169+
}
170+
167171
if (isset(static::$resolvedInstance[$name])) {
168172
return static::$resolvedInstance[$name];
169173
}

src/Illuminate/Support/Facades/Schema.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public static function connection($name)
2525
}
2626

2727
/**
28-
* Get the registered name of the component.
28+
* Get a schema builder instance for the default connection.
2929
*
30-
* @return string
30+
* @return \Illuminate\Database\Schema\Builder
3131
*/
3232
protected static function getFacadeAccessor()
3333
{
34-
return 'db.schema';
34+
return static::$app['db']->connection()->getSchemaBuilder();
3535
}
3636
}

tests/Database/DatabaseMigratorIntegrationTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ protected function setUp(): void
3737
$container = new Container;
3838
$container->instance('db', $db->getDatabaseManager());
3939

40-
$container->bind('db.schema', function ($c) {
41-
return $c['db']->connection()->getSchemaBuilder();
42-
});
43-
4440
Facade::setFacadeApplication($container);
4541

4642
$this->migrator = new Migrator(

0 commit comments

Comments
 (0)