<?php

namespace App\Models;

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

class Genre extends Model
{
    use HasFactory;

    
    public function goods() {
        return $this->hasMany(Goods::class, 'genre_id', 'id');
    }

    public function parent()
    {
        return $this->belongsTo(Genre::class, 'parent_id', 'id');
    }
}
