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 the return from pluck is array based so indexing gives us the value for the particular column you need to pluck from table.
Hope this will give you an idea or solution to your problem.
Happy Learning, Happy Learning Laravel!
In today’s fast-paced work environment, meetings are essential but can often feel unproductive. However, by…
Gold is one of the most coveted precious metals in the world, adored for its…
Gold, the shimmering metal synonymous with wealth, power, and beauty, has been deeply intertwined with…
How to Onboard an Intern in a Small, Individual-Based Company Hiring an intern can be…