<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\IamPrincipal;
use App\Models\FeedbackReaction;

class ManageFeedback extends Model
{
    use SoftDeletes;
    use HasFactory;
    protected $table = "manage_feedback";
    protected $fillable = ['principal_xid', 'feedback_reaction_xid', 'comment','is_app_feedback','is_restaurant_feedback','restaurant_id'];

    public function principal()
    {
        return $this->belongsTo(IamPrincipal::class, 'principal_xid', 'id')->withDefault([
            'id' => null, // Default id value
            // Add more default attributes as needed
        ]);
    }


    public function feedbackReaction()
    {
        return $this->belongsTo(feedbackReaction::class, 'feedback_reaction_xid', 'feedback_reaction_xid');
    }


    public function restaurant()
    {
        return $this->belongsTo(ManageRestaurant::class, 'restaurant_id', 'id');
    }




}
