46 lines
1.0 KiB
PHP
46 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class FieldJobSetting extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'segment_id',
|
|
'initial_decision_id',
|
|
'asign_decision_id',
|
|
'complete_decision_id',
|
|
];
|
|
|
|
public function segment(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Segment::class);
|
|
}
|
|
|
|
public function asignDecision(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Decision::class, 'asign_decision_id');
|
|
}
|
|
|
|
public function initialDecision(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Decision::class, 'initial_decision_id');
|
|
}
|
|
|
|
public function completeDecision(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Decision::class, 'complete_decision_id');
|
|
}
|
|
|
|
public function fieldJobs(): HasMany
|
|
{
|
|
return $this->hasMany(FieldJob::class);
|
|
}
|
|
}
|