<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use App\Blameable;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Anggota extends Model
{
    use SoftDeletes, Blameable;

    protected $table = 'data_anggota_master';
    public $incrementing = false;
    protected $keyType = 'string';

    protected $casts = [
        'tgl_lahir' => 'date',
        'agama' => 'int',
        'status_marital' => 'int',
        'status' => 'int',
        'created_by' => 'int',
        'updated_by' => 'int',
        'deleted_by' => 'int'
    ];

    protected $guarded = [];

    public function kredit()
    {
        return $this->hasMany(Kredit::class, 'anggota_id');
    }

    public function tabungan()
    {
        return $this->hasMany(Tabungan::class, 'anggota_id');
    }
}
