Files
timebank-cc-public/app/Http/Livewire/QuillEditor.php
Ronald Huynen 2547717edb Initial commit
2026-03-23 21:37:59 +01:00

40 lines
758 B
PHP

<?php
namespace App\Http\Livewire;
use App\Rules\MaxLengthWithoutHtml;
use Livewire\Attributes\Rule;
use Livewire\Component;
class QuillEditor extends Component
{
public $content;
public function mount($content)
{
$this->content = $content;
}
public function updatedContent()
{
$maxLength = timebank_config('posts.content_max_input', 1000);
$this->validateOnly('content', [
'content' => ['required', 'string', 'min:10', new MaxLengthWithoutHtml($maxLength)]
]);
}
public function updated()
{
$this->dispatch('quillEditor', $this->content);
}
public function render()
{
return view('livewire.quill-editor');
}
}