invoiceninja/app/Models/Quote.php

42 lines
708 B
PHP
Raw Normal View History

2019-04-04 10:30:49 +11:00
<?php
namespace App\Models;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
class Quote extends BaseModel
{
use MakesHash;
protected $guarded = [
'id',
];
const STATUS_DRAFT = 1;
const STATUS_SENT = 2;
const STATUS_APPROVED = 4;
const STATUS_OVERDUE = -1;
public function company()
{
return $this->belongsTo(Company::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
public function invitations()
{
2019-04-24 10:22:02 +10:00
return $this->hasMany(QuoteInvitation::class);
2019-04-04 10:30:49 +11:00
}
2019-04-24 10:22:02 +10:00
2019-04-28 15:31:32 +10:00
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
2019-04-04 10:30:49 +11:00
}