Only show header action if table has records
Is there a better(performance/cached) way of only showing a header action if the table has records?
Solution:Jump to solution
So, looking into the table component, it calls $records = $getRecords() and also uses count($records) ... so, what you're doing is probably fine.
2 Replies
Solution
So, looking into the table component, it calls $records = $getRecords() and also uses count($records) ... so, what you're doing is probably fine.
https://github.com/filamentphp/filament/blob/d88debaf627171ce183216205f48ec76b49b785f/packages/tables/resources/views/index.blade.php#L56
https://github.com/filamentphp/filament/blob/d88debaf627171ce183216205f48ec76b49b785f/packages/tables/resources/views/index.blade.php#L267
GitHub
filament/packages/tables/resources/views/index.blade.php at d88deba...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament