sentry-laravel
sentry-laravel copied to clipboard
Handler for Model::preventAccessingMissingAttributes()
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?)
This sounds reasonable. The way we currently report lazy loading violations to Sentry is a bit of a hack, though, as we do not use the issue platform, which powers N+1 queries performance issues but instead create a normal error.