<?php

declare(strict_types=1);

namespace App\Models;

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

class NovaCardAssetPack extends Model
{
    public const TYPE_ASSET = 'asset';
    public const TYPE_TEMPLATE = 'template';

    protected $fillable = [
        'slug',
        'name',
        'description',
        'type',
        'preview_image',
        'manifest_json',
        'official',
        'active',
        'order_num',
    ];

    protected $casts = [
        'manifest_json' => 'array',
        'official' => 'boolean',
        'active' => 'boolean',
        'order_num' => 'integer',
    ];

    public function assets(): HasMany
    {
        return $this->hasMany(NovaCardAsset::class, 'asset_pack_id');
    }
}