diff --git a/docs/columns/available-methods.md b/docs/columns/available-methods.md index 8ac5afe09..ebd7fa051 100644 --- a/docs/columns/available-methods.md +++ b/docs/columns/available-methods.md @@ -75,10 +75,10 @@ You can either modify that value or bypass it entirely. ### Modifying the column value -If you would like to modify the value of the column, you can chain the `format` method: +If you would like to modify the value of the column, you can chain the `format` method, note that the column must exist. ```php -Column::make('Name') +Column::make('Name', 'first_name') ->format( fn($value, $row, Column $column) => $row->first_name . ' ' . $row->last_name ), @@ -91,7 +91,7 @@ If you would like to return HTML from the format method you may: ```php Column::make('Name') ->format( - fn($value, $row, Column $column) => ''.$row->first_name . ' ' . $row->last_name.'' + fn($value, $row, Column $column) => ''.$row->name.'' ) ->html(), ```