added eager load config

This commit is contained in:
Denis Duliçi 2021-08-10 23:10:26 +03:00
parent f1072f348f
commit 707207185b
2 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,7 @@ class App extends Provider
Paginator::useBootstrap();
Model::preventLazyLoading();
Model::preventLazyLoading(config('app.eager_load'));
Model::handleLazyLoadingViolationUsing(function ($model, $relation) {
$class = get_class($model);

View File

@ -18,6 +18,8 @@ return [
'schedule_time' => env('APP_SCHEDULE_TIME', '09:00'),
'eager_load' => (bool) env('APP_EAGER_LOAD', true),
/*
|--------------------------------------------------------------------------
| Application Environment