data.idis an empty string? You never give it a value ?
And what is that object in the first code block ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I tried a thousand different ways, even checking the docs but I cannot get it to work.
Object { id: 1, cart_id: 1, product_id: 2, amount: 4, created_at: "2023-02-03T09:44:11.000000Z", updated_at: "2023-02-03T10:48:40.000000Z" }
const { data, setData, destroy, processing, errors, reset } = useForm({
id: '',
});
destroy(route('item.destroy', data.id), {preserveScroll: true});
public function destroy($id)
{
dd($id);
}
Please or to participate in this conversation.