devlogx / filament-pirsch-dashboard-widget

Display the most interesting analytics data in your dashboard
MIT License
4 stars 0 forks source link

Trying to access array offset on value of type null #2

Closed devhoussam1998 closed 3 months ago

devhoussam1998 commented 3 months ago

What happened?

Trying to access array offset on value of type null

How to reproduce the bug

AdminPanelProvider.php

<?php

namespace App\Providers\Filament;

use Devlogx\FilamentPirsch\FilamentPirschPlugin;
use Filament\Panel;
use Filament\PanelProvider;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->default()
            ->id('admin')
            ->path('admin')
            ->plugins([
                FilamentPirschPlugin::make(),
            ]);
    }
}

Dashboard.php

<?php

namespace App\Filament\Admin\Pages;

use Devlogx\FilamentPirsch\Widgets\PirschStatsWidget;
use Filament\Pages\Page;

class Dashboard extends Page
{
    protected function getHeaderWidgets(): array
    {
        return [
            PirschStatsWidget::class,
        ];
    }
}

Package Version

2

PHP Version

^8.2

Laravel Version

^11.0

Which operating systems does with happen with?

No response

Notes

No response

jetwes commented 3 months ago

I had the same issue - make sure that you use the HasFilter Concern on your Page (see doc)

DevRaeph commented 3 months ago

Exactly. the HasFilter Concern has to be present on the Dashboard or View Page. :)