<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Task extends Model { protected $fillable=['project_id','title','description','reporter_user_id','primary_assignee_id','priority','status','estimate_minutes','start_date','due_date','labels','acceptance_criteria','blocked_reason','completed_at']; protected function casts():array{return ['start_date'=>'date','due_date'=>'date','labels'=>'array','completed_at'=>'datetime'];} public function project(){return $this->belongsTo(Project::class);} public function assignee(){return $this->belongsTo(User::class,'primary_assignee_id');} public function collaborators(){return $this->belongsToMany(User::class,'task_assignees');} }