fix tables to have school year, and remove school year from other tables.
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 5m48s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 1m33s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped

This commit is contained in:
root
2026-07-06 22:27:21 -04:00
parent 304fa6bfd0
commit 58726ee0e9
13 changed files with 1343 additions and 120 deletions
+2 -10
View File
@@ -18,12 +18,10 @@ class UserRole extends BaseModel
protected $fillable = [
'user_id',
'role_id',
'semester',
'school_year',
'created_at',
'updated_at',
'updated_by',
'deleted_at',
'updated_by',
];
protected $casts = [
@@ -67,11 +65,7 @@ class UserRole extends BaseModel
public function scopeForSchoolYear(Builder $q, ?string $schoolYear): Builder
{
if ($schoolYear === null || trim($schoolYear) === '') {
return $q;
}
return $q->where('school_year', $schoolYear);
return $q;
}
/* ============================================================
@@ -175,8 +169,6 @@ class UserRole extends BaseModel
return [
'user_id' => [$req, 'integer', 'min:1', 'exists:users,id'],
'role_id' => [$req, 'integer', 'min:1', 'exists:roles,id'],
'semester' => ['nullable', 'string', 'max:20'],
'school_year' => ['nullable', 'string', 'max:20'],
'updated_by' => ['nullable', 'integer'],
];
}