diff --git a/backend/lists.md b/backend/lists.md index 868ef9a3..b1480284 100644 --- a/backend/lists.md +++ b/backend/lists.md @@ -1070,6 +1070,21 @@ public function evalUppercaseListColumn($value, $column, $record) } ``` +It is also possible to extend the Lists widget class to add a new column type like this: + +```php +public function boot() +{ + Backend\Widgets\Lists::extend(function ($widget) { + $widget->addDynamicMethod('evalUppercaseTypeValue', function ($record, $column, $value) { + return strtoupper($value); + }); + }); +} +``` + +> **NOTE**: the order of the arguments is different than when using `registerListColumnTypes()` + Using the custom list column type is as simple as calling it by name using the `type` option. ```yaml