order list by relation field #945
-
I have a table sales and a relation customer with customers table |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The attribute I'm also using a select column in one of my projects, and it is orderable by default. Here's the definition of it: // Column inside setupListOperation()
CRUD::column('category_id')->type('select')->label('Category')->entity('category')->attribute('name')
->model(App\Models\VisitorCategory::class); // Model relationship
public function category()
{
return $this->belongsTo('App\Models\VisitorCategory', 'category_id');
} I hope this example will help you. |
Beta Was this translation helpful? Give feedback.
Hey @soluzione-software
The attribute
'orderable' => true,
is used only when you want to set Custom Order Logic for Column.I'm also using a select column in one of my projects, and it is orderable by default. Here's the definition of it:
I hope this example will help you.