Skip to content

Commit 37491c8

Browse files
authored
Update crud-columns.md
bad field in join
1 parent 86c0f9d commit 37491c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

6.x/crud-columns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ $this->crud->addColumn([
15421542
'attribute' => 'name', // foreign key attribute that is shown to user
15431543
'orderable' => true,
15441544
'orderLogic' => function ($query, $column, $columnDirection) {
1545-
return $query->leftJoin('categories', 'categories.id', '=', 'articles.select')
1545+
return $query->leftJoin('categories', 'categories.id', '=', 'articles.category_id')
15461546
->orderBy('categories.name', $columnDirection)->select('articles.*');
15471547
}
15481548
]);

0 commit comments

Comments
 (0)