<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Task extends Model
{
    protected $table = 'tasks';
    protected $primaryKey = 'id';
    public $timestamps = true;

    public function getTaskType()
    {
        return $this->belongsTo('\App\CreateTask', 'create_task_id', 'id');
    }
    // public function getProjectInterested()
    // {
    //     return $this->hasMany('\App\TaskInterestedProject', 'task_id', 'id');
    // }
    public function getProject()
    {
        return $this->belongsTo(PreferredProject::class, 'project', 'id');
    }
    public function getLeadCategory()
    {
        return $this->belongsTo('\App\LeadCategory', 'lead_category', 'id');
    }
    // public function getLeadStage()
    // {
    //     return $this->belongsTo('\App\LeadStage', 'lead_stage', 'id');
    // }
    // public function getFollowupStatus()
    // {
    //     return $this->belongsTo('\App\FollowupStatus', 'followp_status', 'id');
    // }
    // public function getSiteVisitStatus()
    // {
    //     return $this->belongsTo('\App\SitevisitStatus', 'sitevisit_status', 'id');
    // }
    // public function getBudget()
    // {
    //     return $this->belongsTo('\App\Budget', 'budget', 'id');
    // }
    public function getCreatedBy()
    {
        return $this->belongsTo('\App\User', 'created_by', 'id');
    }
    public function getLead()
    {
        return $this->belongsTo(Lead::class, 'lead_id', 'id');
    }
}
