@@ -88,6 +88,48 @@ protected function singleton($abstract, $concrete = null)
88
88
$ this ->app ->singleton ($ abstract , $ concrete );
89
89
}
90
90
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
+
91
133
/**
92
134
* Register aliases (Facades).
93
135
*/
@@ -156,39 +198,4 @@ protected function filesystem()
156
198
{
157
199
return $ this ->app ['files ' ];
158
200
}
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
- }
194
201
}
0 commit comments