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