Skip to content

Commit 0334faf

Browse files
committed
Add registered provider field to ModuleContaiter class
1 parent b6e076e commit 0334faf

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/ModuleContainer.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ class ModuleContainer implements ModuleContainerInterface, Jsonable, Arrayable
5656
*/
5757
protected $controllerNamespacePrefix = 'Http\\Controllers';
5858

59+
/**
60+
* @var \Illuminate\Support\ServiceProvider|null
61+
*/
62+
protected $provider;
63+
5964
/**
6065
* @param string $moduleName
6166
* @param null|string $modulePath
@@ -200,6 +205,14 @@ public function getServiceProviderPath()
200205
return $this->getPath(['Providers', 'ModuleServiceProvider.php']);
201206
}
202207

208+
/**
209+
* @return \Illuminate\Support\ServiceProvider|null
210+
*/
211+
public function getProvider()
212+
{
213+
return $this->provider;
214+
}
215+
203216
/**
204217
* @param \Illuminate\Foundation\Application $app
205218
*
@@ -228,7 +241,7 @@ public function register($app)
228241

229242
$serviceProviderPath = $this->getServiceProviderPath();
230243
if (is_file($serviceProviderPath)) {
231-
$app->register($this->getNamespace().'\Providers\ModuleServiceProvider');
244+
$this->provider = $app->register($this->getNamespace().'\Providers\ModuleServiceProvider');
232245
}
233246

234247
$this->isRegistered = true;

0 commit comments

Comments
 (0)