Transform your single table into a grouped table list.
The main logic here lives in a custom page with a custom Livewire component that houses a Filament table:
Order
column has a custom implementation that displays a badge for X amount of places (configured in the config file)Name
column has a prefix that displays the team flagMatches Played
column counts how many games were played in real timeWins
and Losses
columns count how many games were won/lost in real-timeTotal Points
column sums up the scored vs. missed points from the format X:Y
in real-timePoints
calculates points in real-time for display (this could be extracted to the database, but we kept it as an example!)Badges
uses a clever Blade injection to display Filament badges based on W or L per each game.Here's what that looks like in our code:
app/Filament/Pages/GroupsOverview.php:
use App\Models\Group;use Filament\Pages\Page;use Filament\Support\Icons\Heroicon; class GroupsOverview extends Page{ // ...
Next, we'll create the groupped table that matches all of our requirements.