F
Filamentβ€’15mo 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β€’15mo ago
Like that ?
No description
Hurruwa
HurruwaOPβ€’15mo ago
no, in a 3 columns array they shoul be 2/3 and 1/3
Hugo
Hugoβ€’15mo ago
That ?
No description
Hugo
Hugoβ€’15mo ago
I'm not sure what you mean
Hurruwa
HurruwaOPβ€’15mo 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β€’15mo ago
ahhhh ok i understand sorry
awcodes
awcodesβ€’15mo ago
i don't think that's possible without making a custom widget
Hurruwa
HurruwaOPβ€’15mo 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β€’15mo ago
OK i have @hurruwa
No description
Hugo
Hugoβ€’15mo 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
HurruwaOPβ€’15mo ago
Thanks a lot
Want results from more Discord servers?
Add your server