<?php

namespace App\Models;

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

class LensCategory extends Model
{
    use HasFactory;

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

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

    public function subCategories()
    {
        return $this->hasMany(LensSubCategory::class);
    }

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