1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00
invoiceninja/app/Models/Project.php

77 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace App\Models;
2020-10-08 00:25:39 +02:00
use App\Models\Filterable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Laracasts\Presenter\PresentableTrait;
/**
* Class Project.
*/
class Project extends BaseModel
{
// Expense Categories
use SoftDeletes;
use PresentableTrait;
2020-10-08 00:25:39 +02:00
use Filterable;
/**
* @var array
*/
protected $dates = ['deleted_at'];
/**
* @var array
*/
protected $fillable = [
'name',
2020-10-08 00:25:39 +02:00
'client_id',
'task_rate',
'private_notes',
2020-10-08 00:25:39 +02:00
'public_notes',
'due_date',
'budgeted_hours',
'custom_value1',
'custom_value2',
2020-10-08 00:25:39 +02:00
'custom_value3',
'custom_value4',
2020-01-21 01:32:34 +01:00
];
public function getEntityType()
{
return self::class;
}
2020-07-23 05:55:11 +02:00
protected $touches = [];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function company()
{
return $this->belongsTo(Company::class);
}
/**
* @return mixed
*/
public function client()
{
return $this->belongsTo(Client::class)->withTrashed();
}
2020-10-11 23:34:02 +02:00
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
// /**
// * @return \Illuminate\Database\Eloquent\Relations\HasMany
// */
// public function tasks()
// {
// return $this->hasMany('App\Models\Task');
// }
}