filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
17.59k stars 2.75k forks source link

Custom table indicator #10104

Closed JoashVisione closed 9 months ago

JoashVisione commented 9 months ago

Package

filament/filament

Package Version

v3.0.0

Laravel Version

v10.0.0

Livewire Version

v3.0.0

PHP Version

PHP 8.2.0

Problem description

Using the Indicator as described in the document is not working. There is actually no class named Indicator

Expected behavior

To expected to show two custom indicators

Steps to reproduce

Create a customer filter inside the table filters and paste in the code below:

use Filament\Forms\Components\DatePicker; use Filament\Tables\Filters\Filter; use Filament\Tables\Filters\Indicator;

Filter::make('created_at') ->form([ DatePicker::make('from'), DatePicker::make('until'), ]) // ... ->indicateUsing(function (array $data): array { $indicators = [];

    if ($data['from'] ?? null) {
        $indicators[] = Indicator::make('Created from ' . Carbon::parse($data['from'])->toFormattedDateString())
            ->removeField('from');
    }

    if ($data['until'] ?? null) {
        $indicators[] = Indicator::make('Created until ' . Carbon::parse($data['until'])->toFormattedDateString())
            ->removeField('until');
    }

    return $indicators;
})

Even the editor shows a compiler error

Reproduction repository

https://github.com/JoashVisione/filament-customer-indicators

Relevant log output

No response

zepfietje commented 9 months ago

Make sure to update Filament and create a real reproduction repository please.

JoashVisione commented 9 months ago

Thank you for reaching out.

How do I update filament and check the current version? I am still a novice.

On Wed, Dec 6, 2023, 12:29 Zep Fietje @.***> wrote:

Closed #10104 https://github.com/filamentphp/filament/issues/10104 as not planned.

— Reply to this email directly, view it on GitHub https://github.com/filamentphp/filament/issues/10104#event-11165556077, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZJRLK3JDNRCZOLIJAXWJLYIA3JLAVCNFSM6AAAAABAIOUJXSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGE3DKNJVGYYDONY . You are receiving this because you authored the thread.Message ID: @.***>