1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00
invoiceninja/app/Models/Quote.php

48 lines
819 B
PHP
Raw Normal View History

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