From 464b8ac6ead4caeac03cf80ea38b0cccab3f597e Mon Sep 17 00:00:00 2001 From: Tobe Obiakor Date: Mon, 16 Nov 2020 10:08:25 +0100 Subject: [PATCH] add a column populated with data fetched from db --- UserExport.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UserExport.php b/UserExport.php index 94444e5..109df06 100644 --- a/UserExport.php +++ b/UserExport.php @@ -19,9 +19,11 @@ public function __construct() { $status=['active','pending','disabled']; $departments=['Account','Admin','Ict','Sales']; + $roles=\App\ModelName::pluck('name')->toArray(); $selects=[ //selects should have column_name and options ['columns_name'=>'D','options'=>$departments], ['columns_name'=>'E','options'=>$status], + ['columns_name'=>'F','options'=>$roles], ]; $this->selects=$selects; $this->row_count=50;//number of rows that will have the dropdown @@ -43,6 +45,7 @@ public function headings(): array 'phone', 'department', 'status', + 'role', ]; }