'integer', 'user_id' => 'integer', 'content' => 'string', ]; /** * @var array */ protected $dates = [ 'created_at', 'updated_at', 'deleted_at', ]; public function task(): BelongsTo { return $this->belongsTo(Task::class, 'task_id'); } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } public function properties(): MorphMany { return $this->morphMany(Property::class, 'entity'); } // related to attachments public function getProjectId(): int { return $this->task->project_id; } }