LaraGrid
  • LaraGrid
  • Installation
  • Publishable
  • Usage
    • Base Usage
      • Create a Grid
      • Display a Grid
    • Examples
  • Theme
    • Default Theme
    • Customize the Theme
  • Column
    • Description
    • Create a Column
    • Methods
    • Usage
  • Column Group
    • Description
    • Create a ColumnGroup
    • Methods
    • Usage
  • Filter
    • Description
    • Available Filters
    • Usage
    • Custom Builder
    • Custom filter
    • Show filtering and sorting in url
  • Filter Reset Button
    • Description
    • Usage
    • Customization
  • Layout
    • Description
    • Usage
  • PowerJoins in LaraGrid
    • Why do we use it
Powered by GitBook
On this page

Was this helpful?

  1. Column

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);
    })
PreviousDescriptionNextMethods

Last updated 1 year ago

Was this helpful?