Uncaught Error: Ziggy error: 'id' parameter is required for route #592
jojogomes12
started this conversation in
General
Replies: 1 comment 5 replies
-
It looks like you're mixing JavaScript and PHP syntax:
Based on your code sample I think this might be closer to what you want: <script>
$.ajax({
type: 'POST',
url: route('update_product', {{ $produto->id }}),
data: $(this).serialize(),
dataType: 'json',
});
</script> If this is a Blade file with a |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a problem using the route with an id
without ziggy I did like this:
Script.js :
Now how would I do with the use of ziggy?
like this give me the error:
url:route('update_product') -> 'id' parameter is required for route
url: route('update_product',['id'=>$product->id) ->Uncaught SyntaxError: Malformed arrow function parameter list
url:route('update_product',{id : this.id}) ->POST http://localhost:8000/products/edit 404 (Not Found)
url:route('update_product', product.id) ->Uncaught ReferenceError: product is not defined
url:route('update_product' ,id: $(this).serialize(id)) -> 'id' parameter is required for route
web.php :
Controller.product :
Beta Was this translation helpful? Give feedback.
All reactions