Skip to content

Commit af3535c

Browse files
Updating the main service provider
1 parent 6548c46 commit af3535c

File tree

1 file changed

+42
-35
lines changed

1 file changed

+42
-35
lines changed

src/ServiceProvider.php

+42-35
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,48 @@ protected function singleton($abstract, $concrete = null)
8888
$this->app->singleton($abstract, $concrete);
8989
}
9090

91+
/**
92+
* Register a service provider.
93+
*
94+
* @param \Illuminate\Support\ServiceProvider|string $provider
95+
* @param array $options
96+
* @param bool $force
97+
*
98+
* @return \Illuminate\Support\ServiceProvider
99+
*/
100+
protected function registerProvider($provider, array $options = [], $force = false)
101+
{
102+
return $this->app->register($provider, $options, $force);
103+
}
104+
105+
/**
106+
* Register multiple service providers.
107+
*
108+
* @param array $providers
109+
*/
110+
protected function registerProviders(array $providers)
111+
{
112+
foreach ($providers as $provider) {
113+
$this->registerProvider($provider);
114+
}
115+
}
116+
117+
/**
118+
* Register a console service provider.
119+
*
120+
* @param \Illuminate\Support\ServiceProvider|string $provider
121+
* @param array $options
122+
* @param bool $force
123+
*
124+
* @return \Illuminate\Support\ServiceProvider|null
125+
*/
126+
protected function registerConsoleServiceProvider($provider, array $options = [], $force = false)
127+
{
128+
return $this->app->runningInConsole()
129+
? $this->registerProvider($provider, $options, $force)
130+
: null;
131+
}
132+
91133
/**
92134
* Register aliases (Facades).
93135
*/
@@ -156,39 +198,4 @@ protected function filesystem()
156198
{
157199
return $this->app['files'];
158200
}
159-
160-
/* ------------------------------------------------------------------------------------------------
161-
| Deprecated Methods
162-
| ------------------------------------------------------------------------------------------------
163-
*/
164-
/**
165-
* Add Aliases into the app.
166-
*
167-
* @deprecated 3.7.0 Use the aliases() method instead and don't forget to add the registerAliases() inside register() method.
168-
*
169-
* @param array $aliases
170-
*
171-
* @return self
172-
*/
173-
protected function addFacades(array $aliases)
174-
{
175-
foreach ($aliases as $alias => $facade) {
176-
$this->addFacade($alias, $facade);
177-
}
178-
179-
return $this;
180-
}
181-
182-
/**
183-
* Add Alias. (Facade)
184-
*
185-
* @deprecated 3.7.0 Use the alias() method instead and don't forget to add the registerAliases() inside register() method.
186-
*
187-
* @param string $alias
188-
* @param string $facade
189-
*/
190-
protected function addFacade($alias, $facade)
191-
{
192-
$this->aliasLoader->alias($alias, $facade);
193-
}
194201
}

0 commit comments

Comments
 (0)