Widget getColumns not working
So, I've made a custom dashboard that has widgets. My issue is, it's not overwriting the default getcolumns() method. I want to have 3 widgets in a row (or more). this is my code:
<?php
namespace App\Filament\Pages;
use App\Filament\Resources\FunnelResource\Widgets\FunnelOverview;
use App\Filament\Resources\ShopResource\Widgets\ShopOverview;
class Dashboard extends \Filament\Pages\Dashboard
{
public function getColumns(): int | string | array
{
return 3;
}
public function getHeaderWidgets(): array
{
return [
ShopOverview::class,
FunnelOverview::make(['title' => 'Total Funnels']),
FunnelOverview::make(['title' => 'Total Active Funnels']),
FunnelOverview::make(['title' => 'Total Draft Funnels']),
FunnelOverview::make(['title' => 'Total Paused Funnels']),
];
}
}
I've put the image of how it is looking, the widgets have colspan set to 1. Please help I am at total loss here
5 Replies
please help, I don't understand why is it not working
thanks guys, it was the getHeaderWidgetsColumns(). Sometimes it takes 5 minutes of your time to help someone not have a panic attack
actually, that one works only if the colspan of the widget is set to 1, and it doesn't look good

You need to set the columnspan ojn your stats widget to be full
help
i did the same and its not working
SOLUTION
hi is there any way i can change how stats are dispalyed based on size of the screen in getColumns()
like this
the funtion return type is only int now