Url generation from BulkAction

I want to generate Identity Cards for selected members from my
MemberResource


The identity cards will be visible to user before printing on a new page.

I have created below bulk action to achieve the same. I have also created a custom page for this new
route
.

BulkAction::make('generate_id')
  ->label('Generate ID Card')
  ->requiresConfirmation()
  ->action(function ($livewire, Collection $records) {
    $memberIds = implode(',', $records->pluck('id')->all());
    $livewire->js("window.open('members/print-id-cards/{$memberIds}', '_blank')");
  })                    


This works and the member IDs are passed to this custom route comma separated. But this exposes IDs to end user.

I would like to convert the route to
POST
instead of
GET
so that I can pass the data to it.

Please help with the same or suggest any other way of achieving this.
Was this page helpful?