boot plugin when class exists

This commit is contained in:
xiaomlove
2022-06-08 15:23:34 +08:00
parent cc68a67d71
commit 7e48a7f15d
+2
View File
@@ -34,10 +34,12 @@ class Plugin
$parts = explode('\\', $provider); $parts = explode('\\', $provider);
if ($parts[0] == 'NexusPlugin') { if ($parts[0] == 'NexusPlugin') {
$className = str_replace('ServiceProvider', 'Repository', $provider); $className = str_replace('ServiceProvider', 'Repository', $provider);
if (class_exists($className)) {
call_user_func([new $className, 'boot']); call_user_func([new $className, 'boot']);
} }
} }
} }
}
private function loadProviders() private function loadProviders()
{ {