<?php

namespace App\Model\User;

use Illuminate\Database\Eloquent\Model;

class PetugasUnitDonorDarahUdds extends Model
{
    //protected $connection = 'connection-name'; //jika menggunakan 2 DB modelnya harus dikasih ini
    //protected $primaryKey = 'your_key_name'; // set primarykeymu jika bukan ID
    protected $table = 'petugas_unit_donor_darah_udds';
    protected $fillable = [
        'nama',
        'unit_donor_darah_id',
        'user_login_id'
    ];
    //public $incrementing = false; //jika primary keynya string
    //public $timestamps = false; //matiin created_at, updated_at

    public function user()
    {
        //localkeymu, idnya
        return $this->belongsTo('App\User', 'user_login_id', 'id');
    }

    public function udd()
    {
        return $this->belongsTo('App\Model\Master\MasterUdd', 'unit_donor_darah_id', 'id');
    }
}
