/** * Register custom form macros on package start * @return void */ public function boot() { Form::macro('uploadcare', function ($name, $value = null, $options = array()) { $options = array_merge($options, array('role' => 'uploadcare-uploader', 'value' => $value)); return Form::input('hidden', $name, $value, $options); }); }
/** * 渲染当前对象 * @return string */ public function render() : string { return FormFacade::input('text', $this->elementName(), $this->value()->show(), ['id' => $this->elementId(), 'class' => 'form-control']); }
protected function renderEditable() : string { return FormFacade::input('text', $this->elementName(), $this->getCurrentValue() ?? $this->getOriginalValue(), $this->getAttributes()); }