Create a Column

Creating a Column

To create a column, you use the make method. This static method creates a new instance of the Column class. It takes two arguments: the model field and the label.

Label is automatically translated with default renderers. If you rewrite the renderer, you need to translate the label yourself.

Column::make('name', 'attributes.name')
Column::make('name', 'attributes.name')
    ->setRenderer(function ($record) {
        return __($record->name);
    })

Last updated