apply the school year concept
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-07-14 00:59:00 -04:00
parent 504c3bc9f9
commit feb1b29a32
73 changed files with 4288 additions and 620 deletions
+8 -18
View File
@@ -103,24 +103,14 @@ class WhatsappController extends BaseController
$sectionName = $row['class_section_name'] ?? ('Section ' . $sectionId);
}
$existing = $this->linkModel->where([
'class_section_id' => $sectionId,
'school_year' => $this->schoolYear,
])->first();
$payload = [
'class_section_id' => $sectionId,
'class_section_name' => $sectionName,
'school_year' => $this->schoolYear,
'invite_link' => trim($inviteLink),
'active' => $active,
];
if ($existing) {
$this->linkModel->update($existing['id'], $payload);
} else {
$this->linkModel->insert($payload);
}
$this->linkModel->upsertLinkForSection(
$sectionId,
$sectionName,
(string) $this->schoolYear,
'',
$inviteLink,
$active === 1
);
return redirect()->back()->with('success', 'WhatsApp group link saved.');
}