<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class ProjectMilestone extends Model {
    use SoftDeletes; protected $guarded=['id']; protected $casts=['due_date'=>'date','baseline_date'=>'date','actual_date'=>'date'];
    public function project(){return $this->belongsTo(Project::class);}
    public function tasks(){return $this->hasMany(ProjectTask::class,'milestone_id');}
    public function dependency(){return $this->belongsTo(self::class,'depends_on_milestone_id');}
}
