workign tests

This commit is contained in:
Mark Gregory
2026-06-26 13:03:03 +01:00
parent 86f0082a84
commit 3cb78f79c7
8 changed files with 62 additions and 25 deletions
+9
View File
@@ -3,6 +3,8 @@
namespace App\Providers;
use Carbon\CarbonImmutable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\LazyLoadingViolationException;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
@@ -24,6 +26,13 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void
{
$this->configureDefaults();
Model::preventLazyLoading(! app()->isProduction());
Model::handleLazyLoadingViolationUsing(function ($model, $relation) {
throw new LazyLoadingViolationException(
$model,
$relation,
);
});
}
/**