belongsTo(Company::class); } /** * @return belongsToMany */ public function employees(): belongsToMany { return $this->belongsToMany(User::class, (new CompanyEmployee())->getTable(), 'module_id','user_id'); } /** * @return BelongsToMany */ public function connections(): belongsToMany { return $this->belongsToMany(CompanyModule::class, (new CompanyConnections())->getTable(), 'module_one', 'module_two'); } }