fix: dropdown kelas ganda — scope forActiveAcademicYear (hanya TA aktif), ikuti filter TA di index; berlaku juga untuk form siswa, import, keluar, mutasi, prestasi, self-service
This commit is contained in:
@@ -36,6 +36,14 @@ class SchoolClass extends Model
|
||||
return $this->belongsTo(AcademicYear::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope: hanya kelas pada tahun ajaran yang sedang aktif.
|
||||
*/
|
||||
public function scopeForActiveAcademicYear($query)
|
||||
{
|
||||
return $query->whereHas('academicYear', fn ($q) => $q->where('is_active', true));
|
||||
}
|
||||
|
||||
public function department(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Department::class);
|
||||
|
||||
Reference in New Issue
Block a user