edvinaskrucas / notification

Notification package for Laravel
MIT License
525 stars 99 forks source link

Notifications do not render #63

Closed gbrock closed 8 years ago

gbrock commented 8 years ago

Notifying from a controller like so:

use Krucas\Notification\Facades\Notification;

class SomeController
{
    protected function notify()
    {
        Notification::success(trans('auth.notification.login'));
        return redirect()->intended('/');
    }
}

...and attempting to render them in my view:

@yield('alerts', Notification::count() ? '<div class="alert-set">' . Notification::showAll() . '</div>' : '')

...results in no notifications ever visible. DebugBar shows that the notifications are available in my session:

array:1 [
  "default" => array:1 [
    0 => Krucas\Notification\Message {#265
      #message: "Welcome!"
      #format: "<div class="alert alert--success">:message</div>"
      #type: "success"
      #flash: true
      #position: null
    }
  ]
]

...and even Notification::count() shows 0. I have followed the installation instructions exactly, as far as I can tell, and instant notifications do work as expected.

Notification version 5.1.0, Laravel version 5.1.26

gbrock commented 8 years ago

Disregard. I had the middleware applied to kernel.php but it was commented out. :no_mouth: