Commit awal: prototipe UI SIAKAD Untan
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Support\Prototype\AdminData;
|
||||
use App\Support\Prototype\Sample;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class LaporanController extends Controller
|
||||
{
|
||||
public function __invoke(): View
|
||||
{
|
||||
$prodi = Sample::prodi();
|
||||
$sebaran = AdminData::sebaranAngkatan();
|
||||
$akreditasi = $prodi->countBy('akreditasi');
|
||||
|
||||
return view('admin.laporan', [
|
||||
'tahun' => Sample::tahunAkademik()->firstWhere('aktif', true),
|
||||
'totalMahasiswa' => (int) $prodi->sum('mahasiswa'),
|
||||
'totalDosen' => Sample::dosen()->count(),
|
||||
'totalProdi' => $prodi->count(),
|
||||
'totalMataKuliah' => Sample::mataKuliah()->count(),
|
||||
'angkatan' => AdminData::angkatan(),
|
||||
'sebaran' => $sebaran,
|
||||
'prodiLabels' => $prodi->pluck('kode')->all(),
|
||||
'prodiData' => $prodi->pluck('mahasiswa')->all(),
|
||||
'akreditasiLabels' => $akreditasi->keys()->all(),
|
||||
'akreditasiData' => $akreditasi->values()->all(),
|
||||
'totalPerAngkatan' => collect(AdminData::angkatan())->mapWithKeys(
|
||||
fn (int $a): array => [$a => $sebaran->sum(fn (array $r): int => $r['angkatan'][$a])]
|
||||
)->all(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user