Add Column in Users Data Table

Laraship QuestionsCategory: TechnicalAdd Column in Users Data Table
Arif Hidyawan asked 6 years ago


How to add column in users data table? For example, phone number column.


1 Answers
laraship Staff answered 6 years ago


You can new columns from both Transformer and DataTable files for Object.

for example to add phone number for Users Table :

1) Corals/core/User/DataTables/UsersDataTable.php

Add :

 'phone' => ['title' => trans('User::attributes.user.phome')

2) Corals/core/User/Transformers/UserTransformer.php

function transform(User $user)

            'phone' => $user->phone,