I upgraded from Filament v3 and noticed some behaviour.
So i have this piece of Code. We were using ->getStateUsing in v3 but ->state ist in de API doc so we changed it. Under the hood it is the same so it doesnt matter anyways.
TextColumn::make('name')
->label('Name')
->state(function (UserPermission $record) {
$userMemberdata = $record->user->getUserMemberData();
dump($userMemberdata->first_name . ' ' . $userMemberdata->last_name);
return $userMemberdata->first_name . ' ' . $userMemberdata->last_name;
}),
The Field in make does not exist - so name does not exists on the Record. It always has beed calculated on the fly
Behaviour in v3: Every Row has the correct name
Behaviour in v4: Every Row has the same name
Also i added a dump and noticed it is only executed in the first row - so I think the value is chached somehow. Could't find anything in the docs https://filamentphp.com/docs/4.x/tables/columns/overview#setting-the-state-of-a-column
I also tried ->formatStateUsing but this method is not executed if the value of make - so the property - does not exist.
I'm missing something but kinda stuck right now. Using Filament v4.1.10