<?php

namespace App\Models;

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

class RequestType extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'slug',
        'active',
        'requires_property_url',
        'supports_campaign_fields',
        'sort_order',
    ];

    protected $casts = [
        'active' => 'boolean',
        'requires_property_url' => 'boolean',
        'supports_campaign_fields' => 'boolean',
        'sort_order' => 'integer',
    ];

    public function marketingRequests()
    {
        return $this->hasMany(MarketingRequest::class, 'request_type_id');
    }
}
