Added error messages to settings.blade.php

This commit is contained in:
Miguel Nogueira 2020-08-31 19:50:58 +01:00
parent 2afea88846
commit 41e3e817a2
2 changed files with 11 additions and 2 deletions

View File

@ -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
{

View File

@ -20,6 +20,12 @@
</script>
@endif
@if (session()->has('error'))
<script>
toastr.error("{{session('error')}}")
</script>
@endif
@if($errors->any())
@foreach ($errors->all() as $error)
<script>toastr.error('{{$error}}', 'Validation error!')</script>