sigd/app/Models/AgencyActivity.php

36 lines
712 B
PHP

<?php
namespace App\Models;
class AgencyActivity extends SigdModel
{
protected $table = 'agency_activity';
protected $fillable = [
'agency_id',
'form_sector',
'form_code',
'row_status',
'created_by',
'updated_by',
];
protected $primaryKey = ['agency_id', 'form_sector', 'form_code'];
public function form()
{
return $this->belongsTo(SettingForm::class, 'form_code', 'code')
->where('form_sector', $this->form_sector);
}
public function agency()
{
return $this->belongsTo(Agency::class, 'agency_id', 'id');
}
public function getKeyName()
{
return $this->primaryKey;
}
}