<?php

namespace App\Models\Institution;

use App\Casts\EmailAddress;
use App\Casts\PhoneNumber;
use Illuminate\Database\Eloquent\Model;

class InstitutionContact extends Model {
    public $fillable = [
        'email',
        'telephone',
        'mobile',
        'name',
        'job_title',
        'is_primary'
    ];

    public $casts = [
        'is_primary' => 'boolean',
        'telephone' => PhoneNumber::class,
        'email' => EmailAddress::class
    ];


    public function institution() {
        return $this->belongsTo(Institution::class);
    }
}
