Perbaikan Absen Tugas Dinas

This commit is contained in:
Ariyutta
2026-10-02 12:51:56 +07:00
parent f17b895329
commit 4937e6faf0
4 changed files with 212 additions and 31 deletions
@@ -33,12 +33,23 @@ class PengajuanPresensi extends Model
function setFileAttribute($value): void
{
// Link eksternal (mis. Google Drive pada tugas dinas) disimpan utuh.
if (str_starts_with((string) $value, 'http')) {
$this->attributes['file'] = $value;
return;
}
$file = explode('/', $value);
$this->attributes['file'] = end($file);
}
function getFileAttribute($value): string
{
if (str_starts_with((string) $value, 'http')) {
return $value;
}
if ($this->bdr_id === null) {
$file = asset("storage/$this->tipe/presensi/$this->periode/$value");
} else {