Skip to content
New issue

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

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

Already on GitHub? # to your account

Prevent undefined property errors #877

Merged
merged 1 commit into from
Jan 12, 2020
Merged

Prevent undefined property errors #877

merged 1 commit into from
Jan 12, 2020

Conversation

matt-allan
Copy link
Contributor

@matt-allan matt-allan commented Jan 10, 2020

If the property name matches the foreign key name creating a BelongsTo relation triggers an undefined property error. Disabling constraints prevents accessing the property and thus prevents the error.

This is a workaround for an issue in Laravel that may or may not be fixed (see laravel/framework#31098). However since we don't actually need the constraints it seems worth disabling them to prevent the underlying issue from surfacing?

Resolves #484.

If the property name matches the foreign key name
creating a BelongsTo relation triggers an undefined
property error. Disabling constraints prevents
accessing the property and thus prevents the error.
Copy link
Collaborator

@mfn mfn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception: Undefined property
3 participants