Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for eloquent strictness #52

Merged
merged 1 commit into from
Oct 17, 2022
Merged

Support for eloquent strictness #52

merged 1 commit into from
Oct 17, 2022

Conversation

ttrig
Copy link
Contributor

@ttrig ttrig commented Oct 13, 2022

https://laravel.com/docs/9.x/eloquent#configuring-eloquent-strictness

Since we're resolving fields in snake, camel and kebab case a MissingAttributeException is thrown when eloquent is configured with $modelsShouldPreventAccessingMissingAttributes.

@wecc
Copy link
Member

wecc commented Oct 14, 2022

Can't we just catch (and ignore) MissingAttributeException in fieldFromObject?

@ttrig
Copy link
Contributor Author

ttrig commented Oct 15, 2022

Can't we just catch (and ignore) MissingAttributeException in fieldFromObject?

See 313782a.
Since models implement ArrayAccess I catch the exception in fieldFromArray as well.

@ttrig ttrig merged commit 4d94398 into master Oct 17, 2022
@ttrig ttrig deleted the support-strict-models branch October 17, 2022 08:06
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.

None yet

8 participants