ok simple request on table TextColumn
How can I for a table populate a colum(A) with the value of another column(B) from the same row if the cell/column A is empty ?
Placeholder or default doesn't permit to be dynamic
Sorry for this simple question but as newbie I'm still learning and sometimes I'm not so experienced to find the best approach / solution to implement
Many thanks
Solution:Jump to solution
->state(fn(YourModel $record) => $record->column_a ?? $record->column_b)
?...3 Replies
Solution
->state(fn(YourModel $record) => $record->column_a ?? $record->column_b)
?or default(fn $record i think
Many thanks , @Leandro Ferreira and @Dan Harrin , both solutions are working like expected ! As I will not use this all the time , I will use the state option as it is easier to remember that it will check the state of the field π and in the documentation of my project it will be easier to understand but your proposition Dan is also working fine
As newbie , I discovered Filament 2...3 weeks ago and it is really amazing what we can do with all you have developped @Dan Harrin and teams !!!! A big thank you for the amazing work and involvement !