first commit

This commit is contained in:
Ariyutta
2026-08-07 10:47:09 +07:00
commit 1c094fbe7f
11630 changed files with 1580900 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
<?php
namespace App\Models\DokSiremun;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Kegiatan extends Model
{
use HasFactory, SoftDeletes;
protected $table = 'public.kegiatans';
protected $guarded = [];
function syarats()
{
return $this->hasMany(Syarat::class, 'id_kegiatan', 'id');
}
function logs()
{
return $this->morphMany(LogPengajuan::class, 'logable');
}
function unit()
{
return $this->belongsTo(UnitKerja::class, 'id_unit_kerja');
}
function unitPembayaran()
{
return $this->belongsTo(UnitKerja::class, 'id_unit_kerja_pimpinan');
}
function getNamaSkAttribute($value): string | null
{
if (!$value) {
return null;
}
if (str_starts_with($value, 'http')) {
return $value;
}
$unit = UnitKerja::find($this->id_unit_kerja);
$sk = "https://siska.untan.ac.id/storage/sk/$unit->nama/$value";
return $sk;
}
}