diff --git a/app/Http/Controllers/EduidczStatisticController.php b/app/Http/Controllers/EduidczStatisticController.php new file mode 100644 index 0000000..708a274 --- /dev/null +++ b/app/Http/Controllers/EduidczStatisticController.php @@ -0,0 +1,40 @@ +addHour(); + + $CACHE_TIME = Cache::remember('CACHE_TIME', $cache_time, function () use ($cache_time) { + return $cache_time; + }); + + $entities = Cache::remember('entities', $CACHE_TIME, function () { + return Federation::whereXml_name('https://eduid.cz/metadata') + ->first() + ->entities() + ->get() + ->filter(fn ($e) => ! $e->hfd); + }); + + // Number of non-HfD entities in eduID.cz + $eduidcz = $entities->count(); + + // Number of eduID.cz entities joined to eduGAIN + $edugain = $entities->filter(fn ($e) => $e->edugain)->count(); + + // Number of SPs in eduID.cz + $services = $entities->filter(fn ($e) => $e->type->value === 'sp')->count(); + + // Number of IdPs in eduID.cz + $organizations = $entities->filter(fn ($e) => $e->type->value === 'idp')->count(); + + return view('statistics', compact('eduidcz', 'edugain', 'services', 'organizations')); + } +} diff --git a/resources/views/statistics.blade.php b/resources/views/statistics.blade.php new file mode 100644 index 0000000..fbf8dd5 --- /dev/null +++ b/resources/views/statistics.blade.php @@ -0,0 +1,47 @@ + + + +
+ + + +eduID.cz | +{{ $eduidcz }} | +
eduGAIN | +{{ $edugain }} | +
eduID.cz services | +{{ $services }} | +
eduID.cz organizations | +{{ $organizations }} | +