id = $name.'-'.Str::random(8); $this->name = $name; $this->value = json_encode($value ?? ''); $this->options = $this->getOptions(); } private function getOptions(): array { return [ 'id' => $this->id, 'name' => $this->name, 'lang' => $this->lang, 'value' => $this->value, ]; } public function render(): View|Closure|string { return view('components.editor'); } }