Files

17 lines
338 B
PHP
Raw Permalink Normal View History

2021-11-22 08:20:49 +02:00
<?php
namespace App\Http\Controllers;
use App\Models\Country;
class CountryController extends Controller
{
public function index()
{
// TASK: load the relationship average of team size
2025-04-05 09:33:22 +09:00
$countries = Country::withAvg('teams', 'size')->get();
2021-11-22 08:20:49 +02:00
return view('countries.index', compact('countries'));
}
}