File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/Illuminate/Foundation/Configuration Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,25 @@ public function withSingletons(array $singletons)
417417 });
418418 }
419419
420+ /**
421+ * Register an array of scoped singleton container bindings to be bound when the application is booting.
422+ *
423+ * @param array $scopedSingletons
424+ * @return $this
425+ */
426+ public function withScopedSingletons (array $ scopedSingletons )
427+ {
428+ return $ this ->registered (function ($ app ) use ($ scopedSingletons ) {
429+ foreach ($ scopedSingletons as $ abstract => $ concrete ) {
430+ if (is_string ($ abstract )) {
431+ $ app ->scoped ($ abstract , $ concrete );
432+ } else {
433+ $ app ->scoped ($ concrete );
434+ }
435+ }
436+ });
437+ }
438+
420439 /**
421440 * Register a callback to be invoked when the application's service providers are registered.
422441 *
You can’t perform that action at this time.
0 commit comments