Update Pengajuan Presensi WhatsApp

This commit is contained in:
Ariyutta
2026-09-19 16:05:56 +07:00
parent 8aa3da65ce
commit 9057ab3643
10000 changed files with 1269273 additions and 1062 deletions
@@ -25,6 +25,7 @@ class PengajuanPresensi extends Model
'kategori',
'keterangan',
'file',
'file_lampiran',
'status',
'status_id',
];
@@ -45,6 +46,31 @@ class PengajuanPresensi extends Model
return $file;
}
function setFileLampiranAttribute($value): void
{
if ($value === null) {
$this->attributes['file_lampiran'] = null;
return;
}
$file = explode('/', $value);
$this->attributes['file_lampiran'] = end($file);
}
function getFileLampiranAttribute($value): ?string
{
if ($value === null) {
return null;
}
if ($this->bdr_id === null) {
return asset("storage/$this->tipe/presensi/$this->periode/$value");
}
return config('baseUri.presensi') . "storage/izin/" . $value;
}
function getKategoriAttribute($value): string
{
if ($this->periode < Periode::where('status', true)->first()->id_periode) {