<?php

declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class NovaCardCollectionItem extends Model
{
    protected $fillable = [
        'collection_id',
        'card_id',
        'note',
        'sort_order',
    ];

    protected $casts = [
        'sort_order' => 'integer',
    ];

    public function collection(): BelongsTo
    {
        return $this->belongsTo(NovaCardCollection::class, 'collection_id');
    }

    public function card(): BelongsTo
    {
        return $this->belongsTo(NovaCard::class, 'card_id');
    }
}