You should send a variable, when you return the view. For example
return View::make('')->with('requests', Friend::FriendsRequest());
solution:
put the next code in routes.php
View::composer('includes.navbar', function($view)
{
$view->with("friendRequest", Friend::FriendsRequest()->count());
});
better explanation in http://culttt.com/2014/02/10/using-view-composers-laravel-4/
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community