Feature #7 : Module Debitur
This commit is contained in:
60
app/Models/Debiture.php
Normal file
60
app/Models/Debiture.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\Village;
|
||||
|
||||
class Debiture extends Base
|
||||
{
|
||||
protected $table = 'debitures';
|
||||
protected $fillable = [
|
||||
'branch_id',
|
||||
'cif',
|
||||
'name',
|
||||
'registered_at',
|
||||
'npwp',
|
||||
'nomor_id',
|
||||
'email',
|
||||
'phone',
|
||||
'nomor_rekening',
|
||||
'province_code',
|
||||
'city_code',
|
||||
'district_code',
|
||||
'village_code',
|
||||
'postal_code',
|
||||
'address',
|
||||
'status',
|
||||
'authorized_at',
|
||||
'authorized_status',
|
||||
'authorized_by'
|
||||
];
|
||||
|
||||
public function branch()
|
||||
{
|
||||
return $this->belongsTo(Branch::class, 'branch_id', 'id');
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_code', 'code');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_code', 'code');
|
||||
}
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(District::class, 'district_code', 'code');
|
||||
}
|
||||
|
||||
public function village()
|
||||
{
|
||||
return $this->belongsTo(Village::class, 'village_code', 'code');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user