How to make the msj with laracast / flash have the closing button?

1

I'm using laravel 5.3. and the laracast / flash package In yes the msj show correctly but the closing button of the flash window does not appear.

According to the laracast documentation now the use should not be placed.

So I use it:

in the controller:

flash("Se ha editado ".$user->nombre." de forma exitosa!", 'success');

In the view the include

@include('flash::message')

This works well but I do not see the closing button of the window of success in this case, I thought it could be the browsers, but in different the same happens

    
asked by Cidius 05.09.2016 в 15:36
source

1 answer

0

According to the Laracasts / flash code, you must do it with the important() method:

flash("Se ha editado ".$user->nombre." de forma exitosa!", 'success')->important();

In the basic view of messages.blade.php you see that you need the value flash_notification.important to show the close button:

        @if(session()->has('flash_notification.important'))
            <button type="button"
                    class="close"
                    data-dismiss="alert"
                    aria-hidden="true"
            >&times;</button>
        @endif

This information is added to the session in the important() method of Laracasts / Flash / FlashNotifier.php

/**
 * Add an "important" flash to the session.
 *
 * @return $this
 */
public function important()
{
    $this->session->flash('flash_notification.important', true);
    return $this;
}
    
answered by 05.09.2016 / 16:53
source