<?php

namespace App\Models\Institution;

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

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

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


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