workign tests
This commit is contained in:
@@ -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,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user