<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Invoice extends Model
{
		protected $table = "invoice";
		protected $guarded=['id'];

	 function user()
	 {
			return $this->belongsTo('App\User','created_by','id');
	 }

	 function items()
	 {
			return $this->hasMany('App\Models\InvoiceItems','invoice_id');
	 }

	 function client()
	 {
			return $this->belongsTo('App\User','client_id','id');
	 }

	 function company()
	 {
			return $this->belongsTo('App\Models\CompanyModel','client_id','id');
	 }

 }