2024-05-29 13:22:54 +05:30
|
|
|
<?php
|
|
|
|
|
|
2024-06-07 12:32:04 +05:30
|
|
|
namespace App\Models;
|
2024-05-29 13:22:54 +05:30
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
use App\Models\IamPrincipal;
|
2024-06-07 12:32:04 +05:30
|
|
|
use App\Models\FeedbackReaction;
|
2024-05-29 13:22:54 +05:30
|
|
|
|
|
|
|
|
class ManageFeedback extends Model
|
|
|
|
|
{
|
|
|
|
|
use SoftDeletes;
|
|
|
|
|
use HasFactory;
|
|
|
|
|
protected $table = "manage_feedback";
|
2024-06-18 12:51:36 +05:30
|
|
|
protected $fillable = ['principal_xid', 'feedback_reaction_xid', 'comment','is_app_feedback','is_restaurant_feedback','restaurant_id'];
|
2024-05-29 13:22:54 +05:30
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
{
|
2024-06-07 12:32:04 +05:30
|
|
|
return $this->belongsTo(feedbackReaction::class, 'feedback_reaction_xid', 'feedback_reaction_xid');
|
2024-05-29 13:22:54 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 13:18:04 +05:30
|
|
|
public function restaurant()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(ManageRestaurant::class, 'restaurant_id', 'id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-29 13:22:54 +05:30
|
|
|
|
|
|
|
|
}
|