FilamentF
Filament3y ago
xy

New widget not working

Im using a new widget for a render hook and seeing this error:

Using $this when not in object context


Widget code:

<x-filament-widgets::widget class="fi-filament-info-widget">

</x-filament-widgets::widget>



<?php

namespace App\Filament\Widgets;

use Filament\Widgets\Widget;

class Sidebar extends Widget
{
    protected static string $view = 'filament.widgets.sidebar';
    public array $actions = [];

    public function mount(): void
    {
        $this->actions = [];
    }

    public function getColumnSpan(): int | string | array
    {
        return [];
    }

    public static function getSort(): int
    {
        return -1;
    }
}
Was this page helpful?