refactor: migrate career applications to separate job and intern Filament resources

This commit is contained in:
Ümit Tunç
2026-06-08 18:17:56 +03:00
parent 5b07f385b1
commit 082fb33af3
17 changed files with 773 additions and 224 deletions
+14
View File
@@ -30,8 +30,22 @@ class CareerApplication extends Model
'internship_end_date',
'internship_total_days',
'github_repo',
'certificate_code',
'transcript_markdown',
];
protected static function booted()
{
static::saving(function ($model) {
if ($model->type === 'internship' && !$model->certificate_code) {
do {
$code = 'TRN-' . date('Y') . '-' . strtoupper(\Illuminate\Support\Str::random(4)) . '-' . strtoupper(\Illuminate\Support\Str::random(4));
} while (static::where('certificate_code', $code)->exists());
$model->certificate_code = $code;
}
});
}
/**
* Get the attributes that should be cast.
*