<?php

namespace App\Models;

use App\Models\BaseModel;

class ParentModel extends BaseModel
{
    protected $table = 'parents';

    // legacy model didn't specify timestamps
    public $timestamps = true;

    protected $fillable = [
        'secondparent_firstname',
        'secondparent_lastname',
        'secondparent_gender',
        'secondparent_email',
        'secondparent_phone',
        'firstparent_id',
        'semester',
        'school_year',
    ];

    protected $casts = [
        'firstparent_id' => 'integer',
    ];

    /* Optional relationship */
    public function firstParentUser()
    {
        return $this->belongsTo(User::class, 'firstparent_id');
    }
}