33 lines
670 B
PHP
33 lines
670 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 Produk extends Model
|
|
{
|
|
use HasFactory, Blameable, SoftDeletes;
|
|
|
|
protected $table = 'produks';
|
|
|
|
protected $fillable = [
|
|
'kategori_produk_id',
|
|
'kode_produk',
|
|
'nama_produk',
|
|
'gambar_produk',
|
|
'deskripsi_produk',
|
|
'harga_produk',
|
|
'stok_produk',
|
|
'tersedia',
|
|
];
|
|
|
|
|
|
public function kategori_produk()
|
|
{
|
|
return $this->belongsTo(KategoriProduk::class, 'kategori_produk_id');
|
|
}
|
|
}
|