<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Form extends Model
{
    use HasFactory;

    protected $table = 'form';
    protected $fillable = [
        'title',
        'description',
        'is_active',
    ];

    protected $casts = [
        'is_active' => 'boolean',
    ];

    public function form_question()
    {
        return $this->hasMany(Form_question::class, 'id_form');
    }

    public function sections()
    {
        return $this->hasMany(Form_section::class, 'id_form');
    }
}
