<?php


namespace Mehrab\Comment\Models;


use Illuminate\Database\Eloquent\Model;
use Mehrab\OrderService\Models\OrderService;
use Mehrab\Service\Models\Service;
use Mehrab\User\Models\User;

//برای بهینه کردن جست و جو بجای پلیمورفیک جدول جدا فراهم شد
class CommentService extends Model
{
    const ACTIVE = 'active';
    const INACTIVE = 'inactive';

    public static $status = [
        self::ACTIVE,
        self::INACTIVE,
    ];

    protected $table="comment_service";

    protected $guarded=[];

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

    public function expert(){
        return $this->belongsTo(User::class,'expert_id');
    }

    public function order(){
        return $this->belongsTo(OrderService::class,'order_id');
    }

    public function service(){
        return $this->belongsTo(Service::class,'service_id');
    }

}
