<?php

namespace App\Models;

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

class Survey extends Model
{
    use HasFactory, SoftDeletes;

    protected $table = 'survey';

    protected $fillable = ['code', 'name',  'title', 'content', 'voucher_event_id'];

    public function detail() {
        return $this->hasMany(SurveyQuestion::class);
    }

    public function voucherEvent() {
        return $this->belongsTo(VoucherEvent::class);
    }
}
