F
Filament2mo ago
Morph

Widget in my dashbaord

No description
No description
4 Replies
Morph
MorphOP2mo ago
Sorry, my message disapear. My probleme is to have widget to same line I have 16 widget. In my DashboardPanelProvider, i have this :
->discoverWidgets(in: app_path('Filament/Dashboard/Widgets'), for: 'App\Filament\Dashboard\Widgets')
->widgets([
ProfileUserWidget::class,
RfqEnCoursWidget::class,
TotalRfqWidget::class,
RfqEnRetardWidget::class,
RfqParApplicationWidget::class,
RfqParBusinessTypeWidget::class,
RfqParContactWidget::class,
RfqParOrganisationWidget::class,
RfqParRegionWidget::class,
RfqParSegmentWidget::class,
RfqParStatutWidget::class,
CaPotentielParAllocationWidget::class,
DureeMoyenneWidget::class,
RfqByStatusChartWidget::class,
RfqBySiteChartWidget::class,
RfqByMonthChartWidget::class,
])
->discoverWidgets(in: app_path('Filament/Dashboard/Widgets'), for: 'App\Filament\Dashboard\Widgets')
->widgets([
ProfileUserWidget::class,
RfqEnCoursWidget::class,
TotalRfqWidget::class,
RfqEnRetardWidget::class,
RfqParApplicationWidget::class,
RfqParBusinessTypeWidget::class,
RfqParContactWidget::class,
RfqParOrganisationWidget::class,
RfqParRegionWidget::class,
RfqParSegmentWidget::class,
RfqParStatutWidget::class,
CaPotentielParAllocationWidget::class,
DureeMoyenneWidget::class,
RfqByStatusChartWidget::class,
RfqBySiteChartWidget::class,
RfqByMonthChartWidget::class,
])
in my widget i put this
protected static ?int $sort = 1;
protected int | string | array $columnSpan = [
'default' => 12,
'md' => 4,
];
}
protected static ?int $sort = 1;
protected int | string | array $columnSpan = [
'default' => 12,
'md' => 4,
];
}
sort 1, 2,3...16 for position at the widget but result it's not good for me i want [widget 1] [widget 2] [widget 3] [widget 4] can you help me i try another work i create a dashboard page
<?php
namespace App\Filament\Dashboard\Pages;
use Filament\Pages\Dashboard as BaseDashboard;
class DashboardPage extends BaseDashboard
{
public function getColumns(): int | array
{
return 4;
}
}
<?php
namespace App\Filament\Dashboard\Pages;
use Filament\Pages\Dashboard as BaseDashboard;
class DashboardPage extends BaseDashboard
{
public function getColumns(): int | array
{
return 4;
}
}
` and in my widget à put this :
<?php

namespace App\Filament\Dashboard\Widgets;

use App\Models\RfqForm;
use Filament\Widgets\StatsOverviewWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class CaPotentielParAllocationWidget extends StatsOverviewWidget
{
protected static ?int $sort = 2;
protected ?string $heading = 'CA Potentiel par Site';
protected ?string $pollingInterval = '30s';

protected int | string | array $columnSpan = 4;
protected function getColumns(): int|array|null
{
return 1;
}
...
<?php

namespace App\Filament\Dashboard\Widgets;

use App\Models\RfqForm;
use Filament\Widgets\StatsOverviewWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class CaPotentielParAllocationWidget extends StatsOverviewWidget
{
protected static ?int $sort = 2;
protected ?string $heading = 'CA Potentiel par Site';
protected ?string $pollingInterval = '30s';

protected int | string | array $columnSpan = 4;
protected function getColumns(): int|array|null
{
return 1;
}
...
i make this for all widget, it's better but not good
Morph
MorphOP2mo ago
No description
Morph
MorphOP2mo ago
I need your help, please! thanks a lot
Dennis Koch
Dennis Koch2mo ago
On the widget you need protected int|string|array $columnSpan = 1; not getColumns()

Did you find this page helpful?