Don't use View::composer() with wildcard
This blog post was originally published a little while ago. Please consider that it may no longer be relevant or even accurate.
This is incredibily obvious in hindsight, but I recently realised a mistake I had been making when trying to share data across all the views in my app. By wanting to make the count of users in the app
use App\User;
View::composer('*', function () {
$view->with('usersCount', User::remember(now()->addDay())->count());
});