I am using PHP Laravel and Twig the php function has a parameter as the following:
function onItemApprove($id){
$data = post();
$item = Spot\Shipment\Models\Item::find($id);
....
$item->update();
}
the twig has the following code :
{{ form_ajax('onItemApprove') }}
I want to pass the parameter $id in the twig form_ajax
You can add option something like this
Inside Handler get it from post, not as a parameter
if any doubt please comment.