MIELICIUS / app / Models / bomsementara.php
bomsementara.php
Raw
<?php

namespace App\Models;

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

class bomsementara extends Model
{
    use HasFactory;

    protected $primaryKey = 'idbomsementara';

    protected $fillable = [
        'idbomnya',
        'kodebah',
        'banyakqty',
        'hargaakhir'
    ];

    public function panggilBahan(){
        return $this->hasOne(Bahan::class,'kodebahan','kodebah');    
    }
}