Monday, March 20, 2017

LARAVEL - Unread messages notifications in all pages

in my project i have front and back office.

I have this

InfoController

 //unread messages
 public function naoLido(){

        $infos = PedidoInfo::where('lido',0)->get();

        return view('layoutadmin' ,compact('infos'));
    }

this works, but how can I use this in all pages? I have an layoutAdmin.blade.php where i had the menus and i want put the number or unread messages there like that, but i have in one page, how can i display in all pages?

 <i class="glyphicon glyphicon-list"></i> Informações 
       @if ($infosL -> count() > 0)
            { $infosL -> count() }}
       @endif
 <span class="caret pull-right"></span>

Thanks



via D. Lopes

Advertisement