Support the ongoing development of →
Eloquent Forms
Last updated 2 years ago.

Probably because your query doesn't return a result so the $products variable is not an object.

Also one time you are using $request->product_name and one time $request->name_product.

Also you are selecting the product based on the name and after that check in the code if the name is the same you just selected.

Also at the top you use $request->product_name and a little lower you use $request->get('product_name').


Thanks friend, but not fix, when update get succes but for create new I get this error, and I changed the name, regards.

   $sum=$exists + $enter;
   if ($compare) {
$upproduct->quantity = $sum;
return redirect('product')->with('message', 'update');
return redirect('product')->with('message','store');

I make dd to $a=$products->name_product;

this result when product exists, dd($a=$products->product_name);

if no existes get object non-property.


Sign in to participate in this thread!


Your banner here too?

njuarezgt njuarezgt Joined 2 Oct 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.