I used a checkbox in the filter and it has default true.
Hi everyone, I used a checkbox in the filter and it has default true. but I want to disable or hide it so the user cannot uncheck it. I am using filament v3
->filters([
Filter::make('selected_location')
->query(function ($query) use ($selectedLocation) {
if ($selectedLocation) {
return $query->where('locations_id', $selectedLocation);
}
return $query;
})->default(true),
)}
Solution:Jump to solution
If you only want to show certain records on the table you can modify the table query to do so.
3 Replies
Solution
If you only want to show certain records on the table you can modify the table query to do so.
Your question is a bit odd since you talk about
selectedRecords
but want to have true
as default.Thank you, sir. It's fixed it.