<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @mixin IdeHelperComment
 */
class Comment extends Model
{
    protected $fillable = [
        'user_id',
        'consultant_id',
        'comment',
        'rate'
    ];

    protected $casts = [
        'rate' => 'integer'
    ];

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

    public function consultantProfile()
    {
        return $this->belongsTo(ConsultantProfile::class, 'consultant_id');
    }
}
