<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class Rate extends Model
{
    //
    use SoftDeletes;
    protected $fillable = [
        'user_id',	'target_id','rate','channel_id','comment'
        ];
    /**
     * Get the description of the category.
     * @return HasMany
     */
    public function user(){
        return $this->belongsTo(User::class,'user_id')->withTrashed();
    }
    public function target()
    {
        return $this->belongsTo(User::class,'target_id')->withTrashed();
    }
    public function member()
    {
        return $this->belongsTo(User::class,'user_id')->withTrashed();
    }
    public function consult()
    {
        return $this->belongsTo(User::class,'target_id')->withTrashed();
    }
    public function channel()
    {
        return $this->belongsTo(Channel::class,'channel_id')->withTrashed();
    }
    
}
