laravel-query-detector
laravel-query-detector copied to clipboard
How to solve this error?
Hi guys,
I have just installed the package and have already resolved some issues. Unfortunately, I don't know how to solve that:
Found the following N+1 queries in this request:
Model: App\\Domains\\Country\\Models\\Country => Relation: App\\Domains\\Country\\Models\\CountryTranslation - You should add "with(\'App\\Domains\\Country\\Models\\CountryTranslation\')" to eager-load this relation.')
In the place where I call $country, I am already making eager-load like this:
Country::with('translations')->where('abbreviation', '=', $params['code'])->first();
How can I solve that?
Have you solved it? It happens to me too
no, it is still unresolved :(