<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Pembelian extends Model
{
    //
    protected $table = "pem_pembelian";
    protected $primaryKey = "id_pembelian";

    public function dataPenyedia()
    {
    	return $this->belongsTo("App\Penyedia", "id_penyedia");
    }

    public function dataPembelianBarang()
    {
    	return $this->hasMany("App\PembelianBarang", "id_pembelian", "id_pembelian");
    }

    public function dataPembelianBayar()
    {
    	return $this->hasMany("App\PembelianBayar", "id_pembelian", "id_pembelian");
    }
}
