add controllers, servoices

This commit is contained in:
root
2026-03-09 02:52:13 -04:00
parent c8de5f7edc
commit d76c871cb7
501 changed files with 34439 additions and 21843 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Services\Assignment;
use App\Models\ClassSection;
class AssignmentSectionService
{
public function __construct(private ClassSection $classSection) {}
public function getSectionNamesMap(array $sectionIds): array
{
if (empty($sectionIds)) {
return [];
}
return $this->classSection
->newQuery()
->whereIn('id', $sectionIds)
->get()
->mapWithKeys(function ($section) {
$name = $section->class_section_name ?? $section->section_name ?? $section->name ?? '';
return [(int) $section->id => (string) $name];
})
->all();
}
}