<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\DraftType
 *
 * @property int $id
 * @property string $name
 * @property int $active
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereActive($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\DraftItem[] $draft_items
 * @property string|null $color
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereColor($value)
 */
class DraftType extends Model
{
    protected $connection = 'mysql';

    protected $table = 'draft_types';

    protected $fillable = [
        'name', 'active', 'color',
    ];

    public function draft_items()
    {
        return $this->hasMany('App\Models\DraftItem', 'draft_type_id', 'id');
    }
}