<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CommentInfoModel extends Model
{
    protected $table = 'comments_info';
    protected $fillable = [
        'interaction_id',
        'user_id',
        'level',
        'content',
    ];
    protected $hidden = ['dream_id','created_at','deleted_at','id'];


    public function CommentUser()
    {
        return $this->belongsTo('App\Models\UserInfoModel','user_id','id');
    }

    public function dream()
    {
        return $this->hasOne('App\Models\DreamInfoModel','id','dream_id');
    }

    public function replay()
    {
        return $this->hasMany('App\Models\ReplyCommentsInfo','comment_id','id');
    }
}
