<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    use SoftDeletes;
    protected $table='comment';
    protected $fillable=['user_id','store_id','content','star','is_reply','comment_id','order_id','is_see'];

    public function comment(){
        return $this->hasMany(Comment::class,'comment_id','id');
    }

    public function user(){
        return $this->hasOne(User::class,'id','user_id');
    }

    public function store(){
        return $this->hasOne(Store::class,'id','store_id');
    }

    public function reply(){
        return $this->hasMany(Comment::class,'id','comment_id');
    }
}
