diff --git a/app/Http/Controllers/OptionsController.php b/app/Http/Controllers/OptionsController.php index 0e6a914..698b34a 100644 --- a/app/Http/Controllers/OptionsController.php +++ b/app/Http/Controllers/OptionsController.php @@ -40,12 +40,15 @@ class OptionsController extends Controller } catch(\Exception $ex) { + $errorCond = true; $request->session()->flash('error', 'An error occurred while trying to save settings: ' . $ex->getMessage()); - exit; } } - $request->session()->flash('success', 'Settings saved successfully!'); + if (!isset($errorCond)) + { + $request->session()->flash('success', 'Settings saved successfully!'); + } } else { diff --git a/resources/views/dashboard/administration/settings.blade.php b/resources/views/dashboard/administration/settings.blade.php index a86d788..e2ebafb 100644 --- a/resources/views/dashboard/administration/settings.blade.php +++ b/resources/views/dashboard/administration/settings.blade.php @@ -20,6 +20,12 @@ @endif + @if (session()->has('error')) + + @endif + @if($errors->any()) @foreach ($errors->all() as $error)