forked from miguel456/rbrecruiter
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)
|
catch(\Exception $ex)
|
||||||
{
|
{
|
||||||
|
$errorCond = true;
|
||||||
$request->session()->flash('error', 'An error occurred while trying to save settings: ' . $ex->getMessage());
|
$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!');
|
$request->session()->flash('success', 'Settings saved successfully!');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$request->session()->flash('error', 'You do not have permission to update this resource.');
|
$request->session()->flash('error', 'You do not have permission to update this resource.');
|
||||||
|
|
|
@ -20,6 +20,12 @@
|
||||||
</script>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if (session()->has('error'))
|
||||||
|
<script>
|
||||||
|
toastr.error("{{session('error')}}")
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if($errors->any())
|
@if($errors->any())
|
||||||
@foreach ($errors->all() as $error)
|
@foreach ($errors->all() as $error)
|
||||||
<script>toastr.error('{{$error}}', 'Validation error!')</script>
|
<script>toastr.error('{{$error}}', 'Validation error!')</script>
|
||||||
|
|
Loading…
Reference in New Issue