preventLazyLoading
0
Исключаем возможность работать со связями в моделях без eager load
app/Providers/AppServiceProvider.php
<?php namespace App\Providers; use Illuminate\Database\Eloquent\Model;use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider{ /** * Register any application services. * * @return void */ public function register() { // } /** * Bootstrap any application services. * * @return void */ public function boot() { Model::preventLazyLoading(!app()->isProduction()); }}