Answers for "Eager realationship in laravel"

PHP
0

Eager realationship in laravel

$parentLineCategories = ProductCategory::with([
            'children' => function ($child) use ($SpecificID) {
                return $child->with([
                    'products' => function ($product) use ($SpecificID) {
                        return $product->with([
                            'types' => function ($type) use ($SpecificID) {
                                return $type->where('id', $SpecificID);
                            }
                        ]);
                    }
                ]);
            }
        ])->get();
Posted by: Guest on October-18-2021

Code answers related to "Eager realationship in laravel"

Browse Popular Code Answers by Language