<?php
namespace App\Models;
class ProjectTask extends BaseModel {
    protected function casts(): array { return ['start_date' => 'date', 'end_date' => 'date']; }
    public function project() { return $this->belongsTo(Project::class); }
    public function parent() { return $this->belongsTo(ProjectTask::class, 'parent_id'); }
    public function children() { return $this->hasMany(ProjectTask::class, 'parent_id'); }
}
