<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class QuestionBankSection extends Model
{
    protected $fillable = ['form_id', 'name', 'description', 'order'];

    public function form()
    {
        return $this->belongsTo(QuestionBankForm::class, 'form_id');
    }

    public function questions()
    {
        return $this->hasMany(QuestionBankQuestion::class, 'section_id')->orderBy('order');
    }
}
