41 lines
850 B
PHP
41 lines
850 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class HistoryKegiatan extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'HistoryKegiatan';
|
|
|
|
protected $primaryKey = 'HistoryKegiatanId';
|
|
|
|
protected $fillable = [
|
|
'PerusahaanId',
|
|
'RefHistoryKegiatanId',
|
|
'Tanggal',
|
|
'Nomor',
|
|
'Keterangan',
|
|
'Dokumen',
|
|
];
|
|
|
|
/**
|
|
* Relasi ke model Perusahaan.
|
|
*/
|
|
public function perusahaan()
|
|
{
|
|
return $this->belongsTo(Perusahaan::class, 'PerusahaanId', 'PerusahaanId');
|
|
}
|
|
|
|
/**
|
|
* Relasi ke model RefHistoryKegiatan.
|
|
*/
|
|
public function refHistoryKegiatan()
|
|
{
|
|
return $this->belongsTo(RefHistoryKegiatan::class, 'RefHistoryKegiatanId', 'RefHistoryKegiatanId');
|
|
}
|
|
}
|