first commit
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use App\Models\Verifikator\Dosen;
|
||||
use App\Models\Verifikator\JabatanPegawaiDetail;
|
||||
use App\Models\Verifikator\Rubrik;
|
||||
use App\Models\Verifikator\Tendik;
|
||||
use App\Models\Verifikator\View\Pegawai;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Syarat extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.syarats';
|
||||
protected $guarded = [];
|
||||
|
||||
function kegiatan()
|
||||
{
|
||||
return $this->belongsTo(Kegiatan::class, 'id_kegiatan', 'id');
|
||||
}
|
||||
|
||||
function statusVerifikasi()
|
||||
{
|
||||
return $this->belongsTo(StatusVerifikasi::class, 'status_verifikasi_id', 'id');
|
||||
}
|
||||
|
||||
function dosen()
|
||||
{
|
||||
return $this->belongsTo(Dosen::class, 'id_pelaksana', 'nip');
|
||||
}
|
||||
|
||||
function tendik()
|
||||
{
|
||||
return $this->belongsTo(Tendik::class, 'id_pelaksana', 'nip');
|
||||
}
|
||||
|
||||
function dokumens()
|
||||
{
|
||||
return $this->hasMany(Dokumen::class, 'id_syarat', 'id');
|
||||
}
|
||||
|
||||
function logs()
|
||||
{
|
||||
return $this->morphMany(LogPengajuan::class, 'logable');
|
||||
}
|
||||
|
||||
function notes()
|
||||
{
|
||||
return $this->morphMany(CatatanPengajuan::class, 'noteable');
|
||||
}
|
||||
|
||||
function syarat()
|
||||
{
|
||||
return $this->belongsTo(Rubrik::class, 'id_rubrik');
|
||||
}
|
||||
|
||||
function jabatan()
|
||||
{
|
||||
return $this->belongsToMany(JabatanPegawaiDetail::class, 'verifikator.jabatan_pegawai_detail_syarats', 'syarat_id', 'jabatan_pegawai_detail_id')->withPivot('poin', 'biaya');
|
||||
}
|
||||
|
||||
function pegawai()
|
||||
{
|
||||
return $this->belongsTo(Pegawai::class, 'id_pelaksana', 'nip');
|
||||
}
|
||||
|
||||
function rubrik()
|
||||
{
|
||||
return $this->belongsTo(Rubrik::class, 'id_rubrik');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user