Records count in table header
Hi, its possible to have current records count (init, but also after filtering or searching) in table header? I tried multiple ways, but without luck yet.
public function updated()
{
$this->total = $this->getFilteredTableQuery()->count();
$this->getTable()->header($this->getTableHeader());
}
public function rendering()
{
$this->total = $this->getFilteredTableQuery()->count();
$this->getTable()->header($this->getTableHeader());
}
protected function getTableHeader(): ?View
{
if ($this->total > 0) {
return view('components.banner', ['message' => $this->total, 'style' => 'warning']);
}
return null;
}