private function composeTotal() { view()->composer('partials.admin_sidebar', function ($view) { $view->with('totalusers', User::all()->count()); //total admin $view->with('totalparticipants', Participant::all()->count()); //total participant $view->with('totalevents', Event::all()->count()); //total event $view->with('totalposts', Post::all()->count()); //total post $view->with('totaltags', Tag::all()->count()); //total tag $view->with('totalimages', Image::all()->count()); //total image }); }