<?php

namespace App\Models;

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

class Ticket extends Model
{
    use HasFactory;

    protected $fillable = [
        'ticket_number',
        'subscriber_id',
        'subscriber_name',
        'subject',
        'description',
        'assignee',
        'status',
        'priority',
        'notify_create',
        'notify_resolve',
    ];

    protected $casts = [
        'notify_create' => 'boolean',
        'notify_resolve' => 'boolean',
    ];

    public function subscriber()
    {
        return $this->belongsTo(Subscriber::class);
    }
}
