I cannot make it work, it seems that working with routes gives me error.
it says CartItem.php
InvalidArgumentException
Please supply a valid name.
it seems its only passing ID and is not enough but in route it says only Id. consequently it has to be ok
Route::get('/cart/add-item/{id}', 'CartController@addItem')->name('cart.addItem');
my view>
<a href="{{route('cart.addItem',$product->id, $product->productName, number_format($product->price, 2, '.', ','))}}" class="btn btn-inverse btn-lg" type="submit">ADD TO CART</a>
thank you!
I cannot make it work, it seems that working with routes gives me error.
it says CartItem.php
it seems its only passing ID and is not enough but in route it says only Id. consequently it has to be ok
Route::get('/cart/add-item/{id}', 'CartController@addItem')->name('cart.addItem');my view>
<a href="{{route('cart.addItem',$product->id, $product->productName, number_format($product->price, 2, '.', ','))}}" class="btn btn-inverse btn-lg" type="submit">ADD TO CART</a>thank you!