I want to use route in javascript but I get an error Route [product.like + productid] not defined.
is there any way I can use route instead ?
Ajax
$.ajax({
method: 'post',
url: '',
data: {
'user_id': userid,
'product_id': productid,
},
Route
Route::post('product/like/{id}', ['as' => 'product.like', 'uses' => 'LikeController@likeProduct']);
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire