Trix
Without file uploads
There are two versions of the Trix field, with and without attachments. The sponsor version has support for file uploads.
Requirements
Requires you to have @stack('styles') in head, and @stack('scripts') after Livewire and Alpine script tags

Trix::make('Trix')
    ->default('The initial value of the trix input') // Example: $this->model->foo
    ->includeExternalScripts() //will only be included once if multiple Trix fields.
    ->rules('nullable|string')//Livewire
public null|string $trix = "Trix input default";<x-tall-trix
    :field="Trix::blade('Trix text editor', 'trix')"
    :value="$trix"
/>Methods
->includeExternalScripts()
Push external (cdn-links) for required scripts and styles to the layout
Omit, if you import the scripts manually
Only pushed once, even if you add multiple Trix fields to the same form.
->default($value)
Use this method to set the initial Trix input value. Use $this->model to access existing model values.
Last updated
Was this helpful?