If i include the Column::make("ID", "id"), the code works correctly and the ID is passed in the action column, However I do not want to display the IDs of each user in the dataTable.
return [
// Exclude the ID column from the table
Column::make("ID", "id"),
Column::make("Name", "name")
->sortable()
->searchable(),
Column::make("Email", "email")
->sortable()
->searchable(),
// Add ID to the Action column for reference
Column::make('Action')
->label(
fn ($row, Column $column) => view('livewire.datatables.action-column', [
'user' => $row,
'column' => $column,
])
)->HTML(),
];
So if I remove the Column::make("ID", "id"), I get a Missing required parameter for [Route: user.view] [URI: user/view/{id}] [Missing parameter: id]. error.
<div>
<a wire:nagivate href="{{ route('user.view', ['id' => $user->id]) }}" class="btn btn-outline-success btn-sm"
title="View this record"><i class="lni lni-eye"></i></a>
<a href="#" class="btn btn-outline-primary btn-sm" title="View this record"><i class="bx bx-pencil"></i></a>
<a href="#" class="btn btn-outline-danger btn-sm" title="View this record"><i class="bx bx-trash"></i></a>
</div>