F
Filamentβ€’10mo ago
Hurruwa

Overview Stats Widget Responsive

Did anyone know how to achieve this? I need to render 2 Stat Cards in 2/3 and 1/3 column composition. I haven't been able to get it so far.. open to ideas. Thanks in advance.
No description
11 Replies
Hugo
Hugoβ€’10mo ago
Like that ?
No description
Hurruwa
Hurruwaβ€’10mo ago
no, in a 3 columns array they shoul be 2/3 and 1/3
Hugo
Hugoβ€’10mo ago
That ?
No description
Hugo
Hugoβ€’10mo ago
I'm not sure what you mean
Hurruwa
Hurruwaβ€’10mo ago
ahha that's 1/3, 1/3, 1/3, What i need is one card to have 2/3 and the other one just 1/3 I dont even know if that is possible
Hugo
Hugoβ€’10mo ago
ahhhh ok i understand sorry
awcodes
awcodesβ€’10mo ago
i don't think that's possible without making a custom widget
Hurruwa
Hurruwaβ€’10mo ago
I have been playing with columnSpan and getColumns() but i cant manage to get it right the way i need it My thoghts exactly... thanks anyhow both πŸ˜‰
Hugo
Hugoβ€’10mo ago
OK i have @hurruwa
No description
Hugo
Hugoβ€’10mo ago
Add a tailwind class with ->extraAttributes(['class' => 'md:col-span-2']) : @hurruwa
protected function getStats(): array
{
return [
Stat::make('Total Formations', Activity::withoutTrashed()->count())->extraAttributes(['class' => 'md:col-span-2']),
Stat::make('Total Sessions de formation', ActivitySession::whereCommitteeId(auth()->user()->committee_id)->count()),
];
}
protected function getStats(): array
{
return [
Stat::make('Total Formations', Activity::withoutTrashed()->count())->extraAttributes(['class' => 'md:col-span-2']),
Stat::make('Total Sessions de formation', ActivitySession::whereCommitteeId(auth()->user()->committee_id)->count()),
];
}
Hurruwa
Hurruwaβ€’10mo ago
Thanks a lot