<?php

namespace App\Models;

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

class ModuleUser extends Model
{
    use HasFactory;

    protected $table = 'module_user';

    protected $fillable = [
        'user_id',
        'module_id',
        'role_scope',
    ];

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

    /**
     * Module relationship.
     */
    public function module()
    {
        return $this->belongsTo(Module::class);
    }
}
