<?php

namespace App\Models;

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

class LensSubCategory extends Model
{
    use HasFactory;

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

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

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

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