/** * Form View Generator for Orchestra\Extension. * * @param \Illuminate\Support\Fluent $model * @param string $name * * @return \Orchestra\Contracts\Html\Form\Builder */ public function configure($model, $name) { return $this->form->of("orchestra.extension: {$name}", function (FormGrid $form) use($model, $name) { $form->setup($this, "orchestra::extensions/{$name}/configure", $model); $handles = data_get($model, 'handles', $this->extension->option($name, 'handles')); $configurable = data_get($model, 'configurable', true); if (!is_null($handles) && $configurable !== false) { $form->fieldset(function (Fieldset $fieldset) use($handles) { // We should only cater for custom URL handles for a route. $fieldset->control('input:text', 'handles')->label(trans('orchestra/foundation::label.extensions.handles'))->value(str_replace(['{{domain}}', '{domain}'], '{domain}', $handles)); }); } }); }
/** * Form View Generator for Orchestra\Extension. * * @param \Illuminate\Support\Fluent $model * @param string $name * * @return \Orchestra\Contracts\Html\Form\Builder */ public function configure($model, $name) { return $this->form->of("orchestra.extension: {$name}", function (FormGrid $form) use($model, $name) { $form->setup($this, "orchestra::extensions/{$name}/configure", $model); $handles = data_get($model, 'handles', $this->extension->option($name, 'handles')); $configurable = data_get($model, 'configurable', true); $form->fieldset(function (Fieldset $fieldset) use($handles, $name, $configurable) { // We should only cater for custom URL handles for a route. if (!is_null($handles) && $configurable !== false) { $fieldset->control('input:text', 'handles')->label(trans('orchestra/foundation::label.extensions.handles'))->value($handles); } $fieldset->control('input:text', 'migrate')->label(trans('orchestra/foundation::label.extensions.update'))->field(function () use($name) { return app('html')->link(handles("orchestra::extensions/{$name}/update", ['csrf' => true]), trans('orchestra/foundation::label.extensions.actions.update'), ['class' => 'btn btn-info']); }); }); }); }
/** * Form View Generator for Orchestra\Extension. * * @param \Illuminate\Support\Fluent $model * @param string $name * * @return \Orchestra\Contracts\Html\Form\Builder */ public function configure($model, $name) { return $this->form->of("orchestra.extension: {$name}", function (FormGrid $form) use($model, $name) { $form->setup($this, "orchestra::extensions/{$name}/configure", $model); $handles = data_get($model, 'handles', $this->extension->option($name, 'handles')); $configurable = data_get($model, 'configurable', true); $publishing = data_get($model, 'publishing', true); $form->fieldset(function (Fieldset $fieldset) use($handles, $name, $configurable, $publishing) { // We should only cater for custom URL handles for a route. if (!is_null($handles) && $configurable !== false) { $fieldset->control('input:text', 'handles')->label(trans('orchestra/foundation::label.extensions.handles'))->value($handles); } if ($publishing === true) { $fieldset->control('input:text', 'migrate')->label(trans('orchestra/foundation::label.extensions.update'))->field($this->getPublishingField($name)); } }); }); }