Skip to content

formatAuditFieldsForPresentation method not working #54

@gam04

Description

@gam04

Hi there.

I find this plugin very useful for quickly viewing the data handled by the laravel-auditing package. However, I have tried to modify the presentation of the old and new values, as indicated in the documentation, using the formatAuditFieldsForPresentation method, but I have not been successful, as it appears that the method is not being called.

Looking into the code a little, I see that in AuditsRelationManager:

 AuditValuesColumn::make('old_values')
                    ->formatStateUsing(fn (Column $column, Model $record, $state) => $this->formatData($record, name: $column->getName(), state: $column->getState()))
                    ->label(trans('filament-auditing::filament-auditing.column.old_values')),

The modification is made using formatStateUsing, which is ‘supposed’ to call formatData, which in turn calls formatAuditFieldsForPresentation. However, formatStateUsing is not called initially, preventing the view change from occurring.

Versions

Laravel Version: v12.25.0
Filament Version: 4.0.3
Plugin Version: 4.0.5
owen-it/Laravel-auditing: 14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions