51 lines
943 B
PHP
51 lines
943 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PipelineItem extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'pipeline_items';
|
|
|
|
protected $fillable = [
|
|
'pipeline_lane_id',
|
|
'title',
|
|
'position',
|
|
'expected_revenue',
|
|
'due_date',
|
|
'description'
|
|
];
|
|
|
|
protected $casts = [
|
|
'next_action' => 'date',
|
|
'expected_revenue' => 'decimal:2',
|
|
'actions' => 'integer',
|
|
'position' => 'integer',
|
|
];
|
|
|
|
public function pipelineLane()
|
|
{
|
|
return $this->belongsTo(PipelineLane::class);
|
|
}
|
|
|
|
/**
|
|
* Get the notes
|
|
*/
|
|
public function notes()
|
|
{
|
|
return $this->morphMany(Note::class, 'notable');
|
|
}
|
|
|
|
/**
|
|
* Get the todos
|
|
*/
|
|
public function todos()
|
|
{
|
|
return $this->morphMany(Todo::class, 'todoable');
|
|
}
|
|
}
|