/** * Get all the update fields * * @param array $keys * @return \Illuminate\Support\Collection */ protected function getUpdateFields(array $keys) { $columns = $this->getTableColumns(); $rowData = $this->getRowData($keys); $formCustomFields = $this->getCustomFormFields(); $fields = collect(); foreach ($columns as $column) { $customProperties = $this->getUpdateAttributes($column, $formCustomFields, $rowData); // Check if the field is not to be shown if ($customProperties->has('hidden')) { continue; } $field = Factory::createField($column, $customProperties->get('type'), $customProperties->toArray()); $fields->push($field); } return $fields; }
public static function build($columnName, $overrides, $defaultProperties) { $field = Factory::createField($columnName, Vector::findOrEmpty($overrides, 'type')); return collect(['align' => 'left', 'label' => String::labelize($columnName), 'width' => null, 'order' => $defaultProperties['order'], 'filter' => $defaultProperties['filter'], 'name' => $columnName])->merge($overrides)->merge(['type' => $field])->toArray(); }