27 lines
452 B
PHP
27 lines
452 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PesananItem extends Model
|
|
{
|
|
protected $table = 'pesanan_items';
|
|
|
|
protected $fillable = [
|
|
'pesanan_id',
|
|
'barang_id',
|
|
'jumlah',
|
|
'total_harga'
|
|
];
|
|
|
|
public function pesanan()
|
|
{
|
|
return $this->belongsTo(Pesanan::class);
|
|
}
|
|
|
|
public function barang()
|
|
{
|
|
return $this->belongsTo(Barang::class);
|
|
}
|
|
}
|