/** * Display a administrator dashboard. * * @return \Illuminate\Http\Response */ public function index() { $activities = Activity::with('contributor')->paginate(8); $statistics = ['ARTICLES' => Article::count(), 'MEMBERS' => Contributor::count(), 'CATEGORIES' => Subcategory::count(), 'MESSAGES' => Message::count(), 'FEEDBACK' => Feedback::count(), 'VISITORS' => (int) Visitor::sum('unique')]; $visitors = Visitor::take(10)->get(); return view('admin.dashboard.index', compact('activities', 'statistics', 'visitors')); }