/** * Record mirations for add fields. */ private function recordAddFieldsMigrations() { if (count($this->add_fields)) { $migrator = new Migrator(); $columns = []; foreach ($this->add_fields as $fname => $fdesc) { if (!empty($fdesc['type'])) { if ($control = Wizard::getAvailControl($fdesc['type'])) { if ($control instanceof \Skvn\CrudWizard\Contracts\WizardableField) { if (!$control->wizardIsForRelationOnly() && !$control->wizardIsForVirtualOnly()) { $dbtype = $control->wizardDbType(); if (!empty($dbtype)) { $columns[$fname] = $dbtype; } } } } } } if (count($columns)) { if ($migrator->appendColumns($this->table, $columns)) { $this->migrations_created = true; } } } }
protected function registerControls() { foreach ($this->app['config']->get('crud_wizard')['wizard_controls'] as $class) { Wizard::registerControl($class); } }