From 1cac42e0e3014704fedbefb38daf688aa3fea612 Mon Sep 17 00:00:00 2001 From: OhmygoodR <109280933+OhmygoodR@users.noreply.github.com> Date: Sat, 14 Sep 2024 23:30:16 +0800 Subject: [PATCH] Update CountryController.php --- app/Http/Controllers/CountryController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/CountryController.php b/app/Http/Controllers/CountryController.php index 2b9be507..37be30c4 100644 --- a/app/Http/Controllers/CountryController.php +++ b/app/Http/Controllers/CountryController.php @@ -9,7 +9,7 @@ class CountryController extends Controller public function index() { // TASK: load the relationship average of team size - $countries = Country::all(); + $countries = Country::withAvg('teams','size'); return view('countries.index', compact('countries')); }