Skip to content

Commit

Permalink
Correcting confusing format() documentation (rappasoft#1135)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrljoe authored Mar 30, 2023
1 parent 43a52d5 commit 8a17b57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/columns/available-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand All @@ -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) => '<strong>'.$row->first_name . ' ' . $row->last_name.'</strong>'
fn($value, $row, Column $column) => '<strong>'.$row->name.'</strong>'
)
->html(),
```
Expand Down

0 comments on commit 8a17b57

Please sign in to comment.