23 lines
378 B
PHP
23 lines
378 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Kategori extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'kategori';
|
|
|
|
protected $fillable = [
|
|
'nama',
|
|
];
|
|
|
|
public function product()
|
|
{
|
|
return $this->hasMany(Product::class, 'id_kategori', 'id');
|
|
}
|
|
}
|