<?php

namespace App\Models;

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

class Tag extends Model
{
    use ApiQuery, GlobalStatus;

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

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

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