<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Category;

class Subcategory extends Model
{
    use SoftDeletes;
    protected $table      = 'subcategory';
    protected $primaryKey = 'subcategory_id';
    protected $fillable   = [
                                'category_id',
                                'category_slug',
                                'subcategory_name',
                                'subcategory_slug',
                                'active_status',
                            ];
    protected $hidden     = [
                                'created_at',
                                'updated_at',
                                'deleted_at',
                            ];

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