Update Pengajuan Presensi WhatsApp
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user