|
6 | 6 | use Adldap\Connections\Provider; |
7 | 7 | use Adldap\Contracts\AdldapInterface; |
8 | 8 | use Adldap\Contracts\Connections\ConnectionInterface; |
| 9 | +use Adldap\Contracts\Schemas\SchemaInterface; |
9 | 10 | use Adldap\Laravel\Exceptions\ConfigurationMissingException; |
10 | 11 | use Adldap\Schemas\Schema; |
11 | 12 | use Illuminate\Contracts\Foundation\Application; |
@@ -79,13 +80,11 @@ protected function addProviders(Adldap $adldap, array $connections = []) |
79 | 80 | { |
80 | 81 | // Go through each connection and construct a Provider. |
81 | 82 | collect($connections)->each(function ($settings, $name) use ($adldap) { |
82 | | - // Set the default schema. |
83 | | - Schema::set(new $settings['schema']()); |
84 | | - |
85 | 83 | // Create a new provider. |
86 | 84 | $provider = $this->newProvider( |
87 | 85 | $settings['connection_settings'], |
88 | | - new $settings['connection']() |
| 86 | + new $settings['connection'](), |
| 87 | + new $settings['schema']() |
89 | 88 | ); |
90 | 89 |
|
91 | 90 | // Try connecting to the provider if `auto_connect` is true. |
@@ -115,11 +114,12 @@ protected function newAdldap() |
115 | 114 | * |
116 | 115 | * @param array $configuration |
117 | 116 | * @param ConnectionInterface|null $connection |
| 117 | + * @param SchemaInterface $schema |
118 | 118 | * |
119 | 119 | * @return Provider |
120 | 120 | */ |
121 | | - protected function newProvider($configuration = [], ConnectionInterface $connection = null) |
| 121 | + protected function newProvider($configuration = [], ConnectionInterface $connection = null, SchemaInterface $schema = null) |
122 | 122 | { |
123 | | - return new Provider($configuration, $connection); |
| 123 | + return new Provider($configuration, $connection, $schema); |
124 | 124 | } |
125 | 125 | } |
0 commit comments