<?php

namespace App\Model;

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

class Form extends Eloquent {
    //
    use SoftDeletes;
	
	protected $connection = 'mongodb';
    protected $collection = 'form_submitted';
	
	// protected $guarded = ['_id'];
	protected $fillable = ['_id','type_service','type_application','status_payment','status_email','remark_form','created_at'];

    public function staff() {
        return $this->belongsTo('App\Model\Staff','_id','dealer_id');
    }

	public function subscriber() {
        return $this->hasOne('App\Model\Subscriber','_id','_id');
    }

    public function packagedetail(){
    	return $this->hasOne('App\Model\PackageDetail','_id','_id');
    }

    public function workorder(){
        return $this->hasOne('App\Model\WorkOrder','_id','_id');
    }

    public function formstatus(){
        return $this->hasMany('App\Model\FormStatus','form_id','_id');
    }

    public function company(){
        return $this->belongsTo('App\Model\Company','_id','company_id');
    }
}
