<?php

declare(strict_types=1);

namespace App\Models;

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

class NovaCardTag extends Model
{
    use HasFactory;

    protected $fillable = [
        'slug',
        'name',
    ];

    public function cards(): BelongsToMany
    {
        return $this->belongsToMany(NovaCard::class, 'nova_card_tag_relation', 'tag_id', 'card_id')
            ->withTimestamps();
    }
}
