transformDatatables($array); } public function transformStatuslabel (Statuslabel $statuslabel) { $array = [ 'id' => e($statuslabel->id), 'name' => e($statuslabel->name), 'type' => $statuslabel->getStatuslabelType(), 'color' => ($statuslabel->color) ? e($statuslabel->color) : null, 'show_in_nav' => ($statuslabel->show_in_nav=='1') ? true : false, 'notes' => e($statuslabel->notes), 'created_at' => Helper::getFormattedDateObject($statuslabel->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($statuslabel->updated_at, 'datetime'), ]; $permissions_array['available_actions'] = [ 'edit' => Gate::allows('admin') ? true : false, 'delete' => Gate::allows('admin') ? true : false, ]; $array += $permissions_array; return $array; } }