From 00bdf9ae6103f71ccde070641d557db5cd764eb9 Mon Sep 17 00:00:00 2001 From: Alfred Nutile Date: Mon, 29 Jul 2024 15:33:43 -0400 Subject: [PATCH] add clear cache --- app/Http/Controllers/SettingController.php | 12 +++++++++--- config/database.php | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 91dacb6f..6fbd68af 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -5,6 +5,7 @@ use App\Http\Resources\SettingResource; use App\Models\Setting; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Artisan; class SettingController extends Controller { @@ -29,7 +30,7 @@ public function updateClaude(Request $request, Setting $setting) $setting->secrets = $secrets; $setting->save(); $setting->updateStep($setting); - + $this->clearCache(); return back(); } @@ -45,7 +46,7 @@ public function updateOllama(Request $request, Setting $setting) $setting->secrets = $secrets; $setting->save(); $setting->updateStep($setting); - + $this->clearCache(); return back(); } @@ -61,7 +62,7 @@ public function updateGroq(Request $request, Setting $setting) $setting->secrets = $secrets; $setting->save(); $setting->updateStep($setting); - + $this->clearCache(); return back(); } @@ -79,7 +80,12 @@ public function updateOpenAi(Request $request, Setting $setting) $setting->secrets = $secrets; $setting->save(); $setting->updateStep($setting); + $this->clearCache(); return back(); } + + protected function clearCache() { + Artisan::call('optimize:clear'); + } } diff --git a/config/database.php b/config/database.php index 3ddc3968..68e8ead3 100644 --- a/config/database.php +++ b/config/database.php @@ -91,7 +91,7 @@ 'prefix' => '', 'prefix_indexes' => true, 'search_path' => 'public', - 'sslmode' => 'prefer', + 'sslmode' => env('DB_SSLMODE', 'prefer'), ], 'sqlsrv' => [