<?php

namespace App\Model;

use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
use Jenssegers\Mongodb\Eloquent\SoftDeletes;

class Company extends Eloquent {
    //
    use SoftDeletes;
    
	protected $connection = 'mongodb';
    protected $collection = 'company';
	
	protected $guarded = ['_id'];

	public function staff() {
        return $this->hasMany('App\Staff','company_id','_id');
    }

    public function dealer()
    {
    	return $this->hasMany('App\DealerLaravel','company_id','_id');
    }

    public function workorder() {
        return $this->hasMany('App\Model\WorkOrderLaravel','contractor_id','_id');
    }

    public function form() {
        return $this->hasMany('App\Model\FormLaravel','company_id','_id');
    }
}
