@props([ 'label' => 'Details', 'rows' => 10, 'placeholder' => 'Write your message...', ]) @php $wireModel = $attributes->wire('model'); $model = $wireModel->value(); $initialValue = $model ? data_get($this, $model, '') : ''; @endphp
whereDoesntStartWith('wire:model')->merge(['class' => 'space-y-2']) }} x-on:helpdesk-editor-reset.window="if ($event.detail.model === model) clear()" x-data="{ model: @js($model), value: @js($initialValue), sync() { this.value = this.$refs.editor.innerHTML; if (this.model) { this.$wire.set(this.model, this.value, false); } }, command(action, value = null) { this.$refs.editor.focus(); document.execCommand(action, false, value); this.sync(); }, clear() { this.value = ''; this.$refs.editor.innerHTML = ''; if (this.model) { this.$wire.set(this.model, '', false); } }, init() { this.$refs.editor.innerHTML = this.value || ''; } }" > @if($model) @endif
@if($model) @error($model)
{{ $message }}
@enderror @endif