Skip to content

Deprecated since 7.2

This page documents the classic module layer (CBController and cbInit()). It still works in every 7.x release, but new code should use resources and pages.

Use instead: A relationship column: TextColumn::make('category.name'), eager loaded.

How To Make A Join Table in Grid Data ​

Table : Products ​

Field NameData Type
idint (PK)
namevarchar(255)
descriptionvarchar(255)
categories_idint(11)

Table : Categories ​

Field NameData Type
idint(PK)
namevarchar(50)

Products ​

php
$this->col[] = ["label"=>"Name","name"=>"name"];
$this->col[] = ["label"=>"Description","name"=>"description"];
$this->col[] = ["label"=>"Category","name"=>"categories_id","join"=>"categories,name"];

What's Next ​

Table Of Contents ​

Released under the MIT License.