Skip to content

Commit

Permalink
revert facade change
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 27, 2019
1 parent d37abcf commit 63d87d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/Illuminate/Database/DatabaseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ protected function registerConnectionServices()
$this->app->bind('db.connection', function ($app) {
return $app['db']->connection();
});

$this->app->bind('db.schema', function ($app) {
return $app['db']->connection()->getSchemaBuilder();
});
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/Illuminate/Support/Facades/Facade.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,15 @@ protected static function getFacadeAccessor()
/**
* Resolve the facade root instance from the container.
*
* @param string $name
* @param object|string $name
* @return mixed
*/
protected static function resolveFacadeInstance($name)
{
if (is_object($name)) {
return $name;
}

if (isset(static::$resolvedInstance[$name])) {
return static::$resolvedInstance[$name];
}
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Support/Facades/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public static function connection($name)
}

/**
* Get the registered name of the component.
* Get a schema builder instance for the default connection.
*
* @return string
* @return \Illuminate\Database\Schema\Builder
*/
protected static function getFacadeAccessor()
{
return 'db.schema';
return static::$app['db']->connection()->getSchemaBuilder();
}
}
4 changes: 0 additions & 4 deletions tests/Database/DatabaseMigratorIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ protected function setUp(): void
$container = new Container;
$container->instance('db', $db->getDatabaseManager());

$container->bind('db.schema', function ($c) {
return $c['db']->connection()->getSchemaBuilder();
});

Facade::setFacadeApplication($container);

$this->migrator = new Migrator(
Expand Down

0 comments on commit 63d87d7

Please sign in to comment.