D
Size: a a a
D
D
И
D
И
И
D
И
И
D
D
D
И
И
D
D
ДК
$products = Products::where('category_id', $id)->get();
Trying to get property 'img' of non-object (View: C:\OSPanel\domains\shop\resources\views\category.blade.php)
if ($request->has('brand')) {
$brands_filter_arr = $request->brand;
foreach ($brands_filter_arr as $brands_item) {
$brand_id = Brands::where('name', 'like', "%$brands_item%")->get()->pluck('id');
$products_new[] = Products::where('brand_id', $brand_id)->get()->all();
}
$products = $products_new;
//dd($products);
}
if ($request->has('brand')) {
$products = Products::join('brands', 'brands.id', 'products.brand_id')
->whereIn('brands.name', $request->get('brands'))
;
}
ДК
И
D