Skip to content

Handler for Model::preventAccessingMissingAttributes() #777

@khalyomede

Description

@khalyomede

Problem Statement

First of all, thank you for giving us a way to handle lazy loading/n+1 queries in production! It is so handy

Do you think we could have the same for Model::preventAccessingMissingAttributes()? This would be very useful too, in case test coverage does not cover all code used in production, and it happens a model attribute is being accessed when it does not exist or has not been loaded!

Solution Brainstorm

I guess it would be very similar to https://github.com/getsentry/sentry-laravel/blob/master/src/Sentry/Laravel/Integration.php#L225-L270 (I wonder if the check done to verify if the model exists can be stripped off for the missing attributes handler?)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions