model = $model; $this->type = $type; $this->inputType = $inputType; $this->required = $required; $this->attr = $attr; $this->value = $value ? $value : ($model->id ? $model->{$attr} : old($attr)); $this->id = $id ? $id : $model::class . '-' . $attr; $this->label = $label ? $label : Str::ucfirst($attr); $this->options = $options; $this->multiple = $multiple; } /** * Get the view / contents that represent the component. * * @return \Illuminate\Contracts\View\View|\Closure|string */ public function render() { return view('components.model-form-control-group'); } }