<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class CalendarTemplate extends Model
{
    protected $table = 'calendar_templates';

    protected $primaryKey = 'id';

    protected $fillable = [
        'box_id', 'default_duration','time_between_wods','start_day_time','end_day_time','days'
    ];

    protected $casts = [
        "days" => "array"
    ];

    protected $with = ['calendarTemplateExclusions'];

    public function box(){
        return $this->belongsTo(Box::class);
    }

    public function calendarTemplateExclusions(){
        return $this->hasMany(CalendarTemplateExclusion::class);
    }
}
