<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class IamPrincipalRestaurantRole extends Model
{
    use HasFactory;
    protected $table = 'iam_principal_restaurant_role';

    protected $fillable = [
        'principal_xid',
        'restaurant_xid',
        'role',
        'created_by',
        'modified_by',
    ];

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