', now()], ['status', 1] ])->get(); $articles = Articles::where('status', 1)->orderBy('updated_at', 'DESC')->get(); $categories = ArticlesCategories::whereHas('articles', function($q) { $q->where('status', 1); })->get(); $montantReductions = 0.0; foreach ($reductions as $reduc) $montantReductions += $reduc->face_value; $nbCustomers = Customers::count(); return view('front.club.index', compact('montantReductions', 'nbCustomers', 'articles', 'categories')); } }