mardi 23 février 2016

Laravel 5 - clearing Flash session

I have a page which uses tabs to display different forms. To do this I do something like the following

<div id="cInfo" class="tab-pane in active fade">
    @if (count($someType) == 0)
        @include('forms.someType.someTypeCreate')
    @else
        @include('forms.someType.someTypeEdit')
    @endif
</div>
<div id="cAndC" class="tab-pane fade">
    @if (count($creative) == 0)
        @include('forms.creative.creativeCreate')
    @else
        @include('forms.creative.creativeEdit')
    @endif
</div>

So each of these tabs is its own independent form/Model, but they are essentially all on the same page, separated by tabs. Now if I take the Controller for someType for instance, when it is created the controller sets the following

Session::flash('flash_message', 'Something updated');
Session::flash('flash_type', 'alert-success');

This works fine, however, if I then click on a new tab to display the creative form, this message is still displayed (because it is theoretically the same page).

Is there any way to clear the session messages when a new tab is clicked?

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1WFMoFy
via IFTTT

Aucun commentaire:

Enregistrer un commentaire