<?php

namespace App\Models;

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

class FrameSubCategory extends Model
{
    use HasFactory;

    protected $fillable = [
        'frame_category_id',
        'vendor_id',
        'name',
        'is_active',
    ];

    protected $casts = [
        'is_active' => 'boolean',
    ];

    public function category()
    {
        return $this->belongsTo(FrameCategory::class, 'frame_category_id');
    }

    public function frames()
    {
        return $this->hasMany(Frame::class, 'sub_category_id');
    }
}
