How the quantity can be changed in admin's products table? (decrease quantity when user add some quantities into the carts table and how to increase product table quantity again when user remove items from the cart?)
this error shows that there is no data in the phone field. you can manually insert from the phpmyadmin or add "?? ' '" right after $product->phone so it will look something like this: {{$product->phone ?? ' '}}. the ?? ' ' is to help bypass the error when there cant be any info found on a specific field
ErrorException Undefined variable $data (View: C:\Users\kiran\OneDrive\Desktop\laravelproject\ordersystem esources\views\user\product.blade.php) sir please give me a solution
When you are showing the cart data you also need to send the count from the controller to view.i also ahowed this in the video.. I think you fast forward that part
in the home controller I sent the count $count=cart::where('phone', $user->phone)->count(); return view('user.home', compact('data', 'count')); but this gives an error in home.blade.php saying it is undefined here Cart[{{$count}}].....please look into this
you should add only user id in cart table instead of name, address and phone. these things you can add in checkout option.
Like This
wow
How the quantity can be changed in admin's products table? (decrease quantity when user add some quantities into the carts table and how to increase product table quantity again when user remove items from the cart?)
Attempt to read property "phone" on null how to fix this?
this error shows that there is no data in the phone field. you can manually insert from the phpmyadmin or add "?? ' '" right after $product->phone so it will look something like this: {{$product->phone ?? ' '}}. the ?? ' ' is to help bypass the error when there cant be any info found on a specific field
ErrorException
Undefined variable $data (View: C:\Users\kiran\OneDrive\Desktop\laravelproject\ordersystem
esources\views\user\product.blade.php)
sir please give me a solution
You probably did not send data from controller properly
$count is undefined.
Why throwing this error
When you are showing the cart data you also need to send the count from the controller to view.i also ahowed this in the video.. I think you fast forward that part
@@WebTechKnowledge
I have thrown data from controller to view.
Did you also send the count to the cart view?
@@happyhappy-jl6yq in home controller you need to send count in view.home and showcart both and this will show
Undefined variable: count (View: F:\Ecommerce1
esources\views\user\home.blade.php)
in the home controller I sent the count
$count=cart::where('phone', $user->phone)->count();
return view('user.home', compact('data', 'count'));
but this gives an error in home.blade.php saying it is undefined here
Cart[{{$count}}].....please look into this
use this code into redirect function then its work, i think u use in index else function
ur email please