props = $this->newAttributeBag([ 'name' => $name, 'id' => $id, 'value' => $value, 'unique_id' => $unique_id, 'required' => $required, 'label' => $label, 'placeholder' => $placeholder, 'class' => collect(['form-control', 'openstamanager-input']), ]); // Operazioni finali $this->init(); } public function get($key, $default = null) { return $this->props->get($key, $default); } public function set($values) { $this->props->setAttributes(array_merge($this->props->getAttributes(), $values)); } public function init() { } /** * Extract the public properties for the component. * * @return array */ public function extractPublicProperties() { $values = parent::extractPublicProperties(); foreach ($this->props as $key => $value) { $values[$key] = $value instanceof Collection ? $value->join(' ') : $value; } return $values; } /** * Get the view / contents that represent the component. * * @return \Illuminate\Contracts\View\View|string */ public function render() { return view('components.input-wrapper'); } }