Browse Source

Fix 修复 #138 后导致的错误

兔姬桑 4 years ago
parent
commit
b8141f6457
1 changed files with 7 additions and 2 deletions
  1. 7 2
      app/Observers/ConfigObserver.php

+ 7 - 2
app/Observers/ConfigObserver.php

@@ -3,12 +3,17 @@
 namespace App\Observers;
 
 use App\Models\Config;
-use Cache;
+use Artisan;
 
 class ConfigObserver
 {
     public function updated(Config $config) // 更新设定
     {
-        Cache::forget('settings');
+        if (config('app.debug')) {
+            Artisan::call('optimize:clear');
+        } else {
+            Artisan::call('optimize:clear');
+            Artisan::call('optimize');
+        }
     }
 }