From 724dd54822c2f0532b972a3820a3d46f8e92588e Mon Sep 17 00:00:00 2001 From: xboard Date: Sat, 23 Aug 2025 15:26:09 +0800 Subject: [PATCH] fix: support resources/views directory for plugin views --- app/Services/Plugin/PluginManager.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Services/Plugin/PluginManager.php b/app/Services/Plugin/PluginManager.php index 3e52dc5..3efe640 100644 --- a/app/Services/Plugin/PluginManager.php +++ b/app/Services/Plugin/PluginManager.php @@ -113,9 +113,10 @@ class PluginManager */ protected function loadViews(string $pluginCode): void { - $viewsPath = $this->getPluginPath($pluginCode) . '/views'; + $viewsPath = $this->getPluginPath($pluginCode) . '/resources/views'; if (File::exists($viewsPath)) { View::addNamespace(Str::studly($pluginCode), $viewsPath); + return; } } @@ -456,9 +457,7 @@ class PluginManager $plugin->setConfig(json_decode($dbPlugin->config, true)); } - if (method_exists($plugin, 'update')) { - $plugin->update($oldVersion, $newVersion); - } + $plugin->update($oldVersion, $newVersion); } $dbPlugin->update([