コード例 #1
0
ファイル: Form.php プロジェクト: laravader/cms
 /**
  * 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;
 }
コード例 #2
0
 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();
 }