I have a problem with ajax url.
The problem is I am using the **resource route and resource controller ** and am trying to update data using modal. I have successfully fetched data into modal by passing route to the anchor tag like this -
<a href="{{ route('productedit.edit', $item->id) }}" class="btn edit_button btn-sm btn primary" data-bs-toggle="modal" data-bs-target="#exampleModal">edit</a>
in ajax let url = $(this).attr("href")
Now I need to submit the form but I am stuck in the ajax URL where I need to put route name {{productedit.update}}
because of using the resource route I need to pass the id with it.
How can I do this?