<?php

namespace App\Modules\Bookings;

use App\Models\ValidationModel;
use App\Modules\Bookings\Template;

class TemplateItem extends ValidationModel
{
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['template_id', 'description', 'value'];

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'template_items';

    /**
     * Array of validation rules.
     *
     * @var  array
     */
    protected static $rules = [
        'template_id' => 'required',
        'description' => 'required',
    ];

    /**
     * Returns all the template items.
     *
     * @return App\Modules\Bookings\TemplateItem
     */
    public function template()
    {
        return $this->belongsTo(Template::class);
    }
}
