belongsTo(User::class, 'created_by_id'); } public function status(): BelongsTo { return $this->belongsTo(TaskStatus::class); } public function labels(): BelongsToMany { return $this->belongsToMany(Label::class); } public function notes(): HasMany { return $this->hasMany('App\Models\Note', 'task_id'); } public function subTasks(): HasMany { return $this->hasMany('App\Models\Task', 'parent_id'); } public function project(): BelongsTo { return $this->belongsTo(Project::class); } public function files(): HasMany { return $this->hasMany('App\Models\File', 'task_id'); } }