63 lines
1.4 KiB
PHP
63 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Modules\Lpj\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
// use Modules\Lpj\Database\Factories\KJPPFactory;
|
|
|
|
class KJPP extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
// Define the table if not using default table naming
|
|
protected $table = 'kjpp';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'code',
|
|
'name',
|
|
'jenis_kantor',
|
|
'nomor_ijin_usaha',
|
|
'province_code',
|
|
'city_code',
|
|
'district_code',
|
|
'village_code',
|
|
'address',
|
|
'postal_code',
|
|
'nomor_telepon_kantor',
|
|
'email_kantor',
|
|
'nama_pimpinan',
|
|
'nomor_hp_pimpinan',
|
|
'nama_pic_reviewer',
|
|
'nomor_hp_pic_reviewer',
|
|
'nama_pic_admin',
|
|
'nomor_hp_pic_admin',
|
|
'nama_pic_marketing',
|
|
'nomor_hp_pic_marketing',
|
|
'ijin_usaha_id',
|
|
'jenis_aset_id',
|
|
'attachment'
|
|
];
|
|
|
|
// relasi ke branch
|
|
public function branch()
|
|
{
|
|
return $this->hasOne(Branch::class, 'jenis_kantor');
|
|
}
|
|
|
|
// relasi ke jenis aset
|
|
public function jenis_aset()
|
|
{
|
|
return $this->hasMany(JenisJaminan::class, 'jenis_aset_id');
|
|
}
|
|
|
|
// relasi ke ijin usaha
|
|
public function ijin_usaha()
|
|
{
|
|
return $this->hasMany(IjinUsaha::class, 'ijin_usaha_id');
|
|
}
|
|
}
|