pluckinlaravel

How to use “where” with “pluck” in laravel?

Hello, Here is the quick solution: $categoryId = ProductCategory::where('id',$id)->pluck('categoryId')[0]; $parentId = ProductCategory::where('id',$id)->pluck('parentId')[0]; print_r($categoryId); print_r($parentId); Plucking it array index 0 as…

2 years ago