Skip to content

Working with routes to add-item gives error. #2

@price2b

Description

@price2b

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions