<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Company extends Model
{
    protected $primaryKey = 'com_id';

    public function country()
    {
        return $this->belongsTo('App\Country', 'country_id', 'country_id');
    }

    public function purchaseOrders()
    {
        return $this->hasMany('App\PurchaseOrder', 'com_id', 'com_id');
    }

    public function stockItems()
    {
        return $this->hasMany('App\StockItems', 'sup_id', 'com_id');
    }

    public function goodsReceivedNotes()
    {
        return $this->hasMany('App\GoodsReceivedNote', 'com_id', 'com_id');
    }

    public function users()
    {
        return $this->hasMany('App\User', 'com_id', 'com_id');
    }


}
