Added error messages to settings.blade.php
This commit is contained in:
parent
2afea88846
commit
41e3e817a2
|
@ -40,13 +40,16 @@ class OptionsController extends Controller
|
|||
}
|
||||
catch(\Exception $ex)
|
||||
{
|
||||
$errorCond = true;
|
||||
$request->session()->flash('error', 'An error occurred while trying to save settings: ' . $ex->getMessage());
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($errorCond))
|
||||
{
|
||||
$request->session()->flash('success', 'Settings saved successfully!');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$request->session()->flash('error', 'You do not have permission to update this resource.');
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue