33 lines
762 B
PHP
33 lines
762 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\Blameable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class KelompokKategori extends Model
|
|
{
|
|
use HasFactory, Blameable, SoftDeletes;
|
|
|
|
protected $table = 'kelompok_kategoris';
|
|
|
|
protected $fillable = [
|
|
'kategori_produk_id',
|
|
'nama_kelompok_kategori',
|
|
'kode_kelompok_kategori',
|
|
];
|
|
|
|
public function kategoriProduk()
|
|
{
|
|
return $this->hasMany(KategoriProduk::class, 'kategori_produk_id');
|
|
}
|
|
|
|
// kelompok kategori pivot
|
|
public function kelompokKategoriPivot()
|
|
{
|
|
return $this->hasMany(KelompokKategoriPivot::class, 'kelompok_kategori_id');
|
|
}
|
|
}
|