<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Status extends Model
{


    protected $table = 'status';

    protected $fillable = array('name','slug','status_type');

    public $timestamps = false;

    public function task()
    {
        return $this->hasOne('App\Task', 'id', 'status_id');
    }
    public function subtask()
    {
        return $this->hasOne('App\Subtask', 'id', 'status_id');
    }

    public function  countTask(){
        //dd($this->id);
        return Task::where('status_id',$this->id)->count();
    }
}
