<?php
/**
 * Created by PhpStorm.
 * User: UNTREF
 * Date: 25/8/2017
 * Time: 12:53 PM
 */

namespace App;


use Illuminate\Database\Eloquent\Model;

class Tasktag extends Model
{

    protected $table = 'task_tag';
    protected $fillable = array('id', 'relation_id', 'type','user_id');
    public $timestamps = true;

    public function user(){

        return $this->belongsTo('App\User','user_id','id','name');

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

    public function eventlog(){

        return $this->hasOne('App\Eventlog','id','relation_id');
    }



}