Skip to content

Conversation

imoceanic
Copy link
Contributor

This is pretty much a duplicate issue of a previous pull request but for the company property
#21

Changes:

Modified the isAllowedProperty method to access the protected array $allowedproperties
Added company and email to this array

This fix ensures that:
The company property is correctly retained and accessible
The code no longer attempts to access the Companies associated type when simply trying to get the company property from a Contact
The original intent of filtering out most HubSpot types is maintained, while solving this specific edge case.

This change should resolve issues for users who were encountering unexpected scope errors when working with contact companies.

Bug Demonstration
Currently, if you run this code:

$contact = Contact::find(555);
dd($contact->company);

If you have the scope access then a Company HubSpot type is returned instead of a simple string.

@jszobody jszobody merged commit 5dfd6fa into stechstudio:main Mar 5, 2025
16 checks passed
@jszobody
Copy link
Member

jszobody commented Mar 5, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants