In columns Role, Position, Department you see ids of these db tables "role","position","department".

How can I paste names instead of ids?
Thanks in advance.
For Detail view check the relation in model and using the relation you do like this:-
'attributes' => [
'title',
'relational_data',
[
'label' => 'Field Name',
'value' => $data->relation_table->field_name,
],
],
For Grid view:-
[
'attribute' => 'role_id',
'value' => function ($data) {
return $data->relation_table->field_name;
},
],
And your Table relation should be like this:-
public function getRelation_table()
{
return $this->hasOne(Table::className(), ['relation_id' => 'id']);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With