<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

/**
 * Class DataJabatan
 *
 * @property int $id
 * @property int $pegawai_id
 * @property int $jabatan_id
 * @property Carbon $tgl_menjabat
 * @property string $jabatan_sk
 *
 * @property TableJabatan $table_jabatan
 * @property DataPegawai $data_pegawai
 *
 * @package App\Models
 */
class Jabatan extends Model
{
	protected $table = 'data_jabatan';
	public $timestamps = false;

	protected $casts = [
		'pegawai_id' => 'int',
		'jabatan_id' => 'int',
		'tgl_menjabat' => 'datetime'
	];

	protected $fillable = [
		'pegawai_id',
		'jabatan_id',
		'tgl_menjabat',
		'jabatan_sk'
	];

	public function jabatan()
	{
		return $this->belongsTo(TableJabatan::class, 'jabatan_id');
	}

	public function pegawai()
	{
		return $this->belongsTo(Pegawai::class, 'pegawai_id');
	}
}
