62 lines
1.4 KiB
PHP
62 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class FormUpCountry extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'form_up_country';
|
|
protected $fillable = [
|
|
'expense_number',
|
|
'user_id',
|
|
'rayon_id',
|
|
'tanggal',
|
|
'tujuan',
|
|
'jarak',
|
|
'allowance',
|
|
'transport_dalkot',
|
|
'transport_ankot',
|
|
'hotel',
|
|
'total',
|
|
'approved_allowance',
|
|
'approved_transport_dalkot',
|
|
'approved_transport_ankot',
|
|
'approved_hotel',
|
|
'approved_total',
|
|
'bukti_allowance',
|
|
'bukti_transport_dalkot',
|
|
'bukti_transport_ankot',
|
|
'bukti_hotel',
|
|
'uc_plan',
|
|
'account_number',
|
|
'status',
|
|
'remarks',
|
|
'approved_at',
|
|
'approved2_at',
|
|
'approved_by',
|
|
'approved2_by',
|
|
'final_approved_at',
|
|
'final_approved_by',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo('App\Models\Admin');
|
|
}
|
|
|
|
public function rayon()
|
|
{
|
|
return $this->belongsTo('App\Models\Rayon');
|
|
}
|
|
|
|
public function attachments()
|
|
{
|
|
return $this->hasMany(\App\Models\AttachmentForm::class, 'form_id')
|
|
->where('table_name', \App\Enums\AttachmentTableName::FORM_UP_COUNTRY);
|
|
}
|
|
}
|