<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;

class Module extends BaseModel
{
    protected $fillable = ['name','status'];
    use HasFactory;
    public function getAllModule()
    {
        return self::get();
    }

    public function submodules() {
        return $this->hasMany('App\Models\Submodule');
    }

    public function getModuleSubmoduleAssoc(){
        return $this->with('submodules')->where('status',1)->get();
    }
}
