Disable Lazy Loading in Development

This commit is contained in:
Refringe 2024-09-30 22:52:44 -04:00
parent 0d043ff880
commit 319e5e65e9
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k

View File

@ -40,6 +40,9 @@ class AppServiceProvider extends ServiceProvider
// Allow mass assignment for all models. Be careful!
Model::unguard();
// Disable lazy loading in non-production environments.
Model::preventLazyLoading(! app()->isProduction());
// Register model observers.
$this->registerObservers();