If you are using Ajax or Axios, you could do something like:
$.ajax({
url: "/generate/pdf",
type: "post",
data: {
"id": [1,2,3,4]
},
success: function(res) {
console.log(res);
}
});
Or, If you are using normal Form Request:
In a hidden input field set value to array of ids.
<input type="hidden" value="[1,2,3,4]" name="id"/>
Then, in the Laravel decode it as:
$ids = json_decode(request('id'));