38 lines
745 B
PHP
38 lines
745 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TaskItem extends Model
|
|
{
|
|
protected $fillable = [
|
|
'service_task_id',
|
|
'label',
|
|
'is_mandatory',
|
|
'is_completed',
|
|
'completed_at',
|
|
'completed_by',
|
|
'data',
|
|
'fields_definition',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_mandatory' => 'boolean',
|
|
'is_completed' => 'boolean',
|
|
'completed_at' => 'datetime',
|
|
'data' => 'array',
|
|
'fields_definition' => 'array',
|
|
];
|
|
|
|
public function serviceTask()
|
|
{
|
|
return $this->belongsTo(ServiceTask::class);
|
|
}
|
|
|
|
public function completedBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'completed_by');
|
|
}
|
|
}
|