hi
I have a problem with the redirect not showing up Flash message
My code:
function onSubmit()
{
$messages = [
'required' => 'This field is required',
'value1.numeric' => 'This field accepts numbers only',
];
$validator = Validator::make(
$form = Input::all(), [
'value1' => 'required|numeric',
],$messages
);
if ($validator->fails()) {
throw new ValidationException($validator);
}
Flash::success(Input::get('value1'));
return Redirect::refresh();
}
My flash message code:
{% flash %}
<div data-control="flash-message" data-interval="5" class="oc-flash-message {{ type }} flash-show" >
<span> {{ message }}</span>
<a class="flash-close"></a>
</div>
{% endflash %}
i include this code in my layouts page
<meta name="turbo-visit-control" content="reload" />
{% framework %}
{% framework extras turbo %}
my Form code:
<form
data-request="onSubmit"
data-request-flash
>
<div class="form-row">
<!-- input start -->
<div class="form-group col-md-4">
<input type="text" class="form-control" name="value1" >
</div>
<div class="form-group col-md-4">
<button data-attach-loading class="btn btn-outline-primary" type="submit">do</button>
</div>
</div>
</form>
When i use return Redirect::refresh(); or Redirect::back(); the success message do not show but error message showing up normal but does not disappear automatically!!!
and
if i disable Turbo Router and include “{% framework extras %}” only the flash message show in info panel "blue panel " above success panel "green panel " meaning it launch 2 flash message one success and other info at the same time !!
-Note: include “{% framework extras turbo %}” show one panel (info panel "blue panel ") even if i use success message
- MY BUILD Version is 3.1.23
Thanks…