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
16.23k stars 2.58k forks source link

formatStateUsing doesn't work #12323

Closed Mahmoudreda66 closed 3 months ago

Mahmoudreda66 commented 3 months ago

Package

filament/filament

Package Version

v3.2

Laravel Version

v10.10

Livewire Version

No response

PHP Version

v8.1

Problem description

i use formatStateUsing method in some of my tables, it works for some columns and don't invoke in others like:

it works and invokes here: Tables\Columns\TextColumn::make('status') ->formatStateUsing(fn (Order $order) => $order->deadline ?? 'Not Exists') ->label('الحالة') ->searchable()

and it doesn't work here:

Tables\Columns\TextColumn::make('deadline') ->label('وقت الانتهاء') ->formatStateUsing(fn (Order $order) => $order->deadline ?? 'Not Exists') ->dateTime() ->sortable()

Tables\Columns\TextColumn::make('branch.name') ->formatStateUsing(fn (Order $order) => $order->deadline ?? 'Not Exists') ->numeric() ->sortable()

Expected behavior

to invoke the function

Steps to reproduce

apply the above code

Reproduction repository

https://github.com/Mahmoudreda66/customer-support

Relevant log output

No response

github-actions[bot] commented 3 months ago

Hey @Mahmoudreda66! We're sorry to hear that you've hit this issue. 💛

However, it doesn't look like you've provided much information on how to replicate the issue. Please edit your original post with clear steps we need to take.