bumdes
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Bumdes;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class KelembagaanAktorBumdes extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'bumdes_kelembagaan_aktor';
|
||||
|
||||
protected $fillable = [
|
||||
'pengurus_bumdes_id',
|
||||
'status_badan_hukum',
|
||||
'nomor_dasar_hukum',
|
||||
'tahun_dasar_hukum',
|
||||
'status_keaktifan',
|
||||
'alasan_tidak_aktif',
|
||||
'unit_usaha',
|
||||
'unit_usaha_jasa_lainnya',
|
||||
'status_unit_komoditas',
|
||||
'nama_unit_komoditas',
|
||||
'status_ad_art',
|
||||
'tahun_ad_art',
|
||||
'pengurus_inti',
|
||||
'memiliki_staf',
|
||||
'jumlah_staf',
|
||||
'unit_usaha_staf',
|
||||
'modal_awal',
|
||||
'tahun_modal_awal',
|
||||
'pernah_penambahan_modal',
|
||||
'penambahan_modal',
|
||||
'aset_produktif',
|
||||
'aset_produktif_lainnya',
|
||||
'status_kepemilikan_aset',
|
||||
'infrastruktur_pascapanen',
|
||||
'infrastruktur_pascapanen_lainnya',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'tahun_dasar_hukum' => 'integer',
|
||||
'tahun_ad_art' => 'integer',
|
||||
'unit_usaha' => 'array',
|
||||
'pengurus_inti' => 'array',
|
||||
'memiliki_staf' => 'boolean',
|
||||
'jumlah_staf' => 'integer',
|
||||
'modal_awal' => 'decimal:2',
|
||||
'tahun_modal_awal' => 'integer',
|
||||
'pernah_penambahan_modal' => 'boolean',
|
||||
'penambahan_modal' => 'array',
|
||||
'aset_produktif' => 'array',
|
||||
'infrastruktur_pascapanen' => 'array',
|
||||
];
|
||||
|
||||
public function pengurusBumdes(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PengurusBumdes::class, 'pengurus_bumdes_id');
|
||||
}
|
||||
|
||||
public function creator(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ use App\Models\Wilayah\DesaKelurahan;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class PengurusBumdes extends Model
|
||||
@@ -105,4 +106,9 @@ class PengurusBumdes extends Model
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function kelembagaanAktor(): HasOne
|
||||
{
|
||||
return $this->hasOne(KelembagaanAktorBumdes::class, 'pengurus_bumdes_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user