'Catatan bimbingan', 'plural' => 'Bimbingan skripsi', 'description' => 'Pantau kemajuan skripsi dan catat setiap sesi bimbingan.']; } protected function abilities(): array { return ['create' => true, 'show' => false, 'edit' => false, 'delete' => false]; } protected function columns(): array { return [ ['label' => 'Tanggal', 'value' => fn (array $r): string => DosenData::tanggal($r['tanggal'])], ['label' => 'Mahasiswa', 'key' => 'nama'], ['label' => 'Topik', 'key' => 'topik'], ['label' => 'Tahap', 'key' => 'tahap', 'badge' => fn (array $r): string => 'accent'], ]; } protected function fields(?array $row): array { $mahasiswa = DosenData::skripsi()->mapWithKeys(fn (array $m): array => [$m['nim'] => "{$m['nama']} ({$m['nim']})"])->all(); $tahap = array_combine(self::TAHAP, self::TAHAP); return [ ['name' => 'nim', 'label' => 'Mahasiswa', 'type' => 'select', 'options' => $mahasiswa, 'rules' => ['required', 'in:'.implode(',', array_keys($mahasiswa))], 'section' => 'Sesi bimbingan'], ['name' => 'tanggal', 'label' => 'Tanggal bimbingan', 'type' => 'date', 'rules' => ['required', 'date', 'before_or_equal:today'], 'default' => today()->toDateString(), 'section' => 'Sesi bimbingan'], ['name' => 'tahap', 'label' => 'Tahap skripsi', 'type' => 'select', 'options' => $tahap, 'rules' => ['required', 'in:'.implode(',', self::TAHAP)], 'section' => 'Sesi bimbingan'], ['name' => 'topik', 'label' => 'Topik pembahasan', 'type' => 'text', 'rules' => ['required', 'string', 'max:120'], 'section' => 'Sesi bimbingan'], ['name' => 'catatan', 'label' => 'Catatan dan arahan', 'type' => 'textarea', 'rules' => ['required', 'string', 'min:10', 'max:1000'], 'hint' => 'Tuliskan arahan dan tindak lanjut untuk mahasiswa.', 'section' => 'Catatan'], ]; } public function index(\Illuminate\Http\Request $request): View { $mahasiswa = DosenData::skripsi(); return view('dosen.skripsi.index', [ 'mahasiswa' => $mahasiswa, 'catatan' => DosenData::catatanSkripsi(), 'rataProgres' => (int) round($mahasiswa->avg('progres')), 'totalSesi' => (int) $mahasiswa->sum('jumlah'), ]); } }