<?php

namespace App\Models;

use App\Traits\GlobalStatus;
use Illuminate\Database\Eloquent\Model;

class Priority extends Model
{
    use  GlobalStatus;

    protected $casts = [
        'converted_color' => 'object'
    ];

    public function supportTickets()
    {
        return $this->hasMany(SupportTicket::class)->primary();
    }
    
    public function pendingSupportTickets()
    {
        return $this->hasMany(SupportTicket::class)->pending();
    }

    public function admin()
    {
        return $this->belongsTo(Admin::class);
    }

}
