Skip to content

Commit f06cbce

Browse files
authored
Merge pull request #1 from obiako/data_from_db
add a column populated with data fetched from db
2 parents bbc98d6 + 464b8ac commit f06cbce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

UserExport.php

+3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ public function __construct()
1919
{
2020
$status=['active','pending','disabled'];
2121
$departments=['Account','Admin','Ict','Sales'];
22+
$roles=\App\ModelName::pluck('name')->toArray();
2223
$selects=[ //selects should have column_name and options
2324
['columns_name'=>'D','options'=>$departments],
2425
['columns_name'=>'E','options'=>$status],
26+
['columns_name'=>'F','options'=>$roles],
2527
];
2628
$this->selects=$selects;
2729
$this->row_count=50;//number of rows that will have the dropdown
@@ -43,6 +45,7 @@ public function headings(): array
4345
'phone',
4446
'department',
4547
'status',
48+
'role',
4649
];
4750
}
4851

0 commit comments

Comments
 (0)