Skip to content

Commit

Permalink
fix: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Oct 19, 2024
1 parent d27106f commit 2b50808
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Quill field for [MoonShine Laravel admin panel](https://moonshine-laravel.com)

### Requirements

- MoonShine v3.0+

### Support MoonShine versions

| MoonShine | Quill |
|-------------|-------|
| 2.0+ | 2.0+ |
| 3.0+ | 3.0+ |


## Installation
```shell
composer require moonshine/quill
Expand Down
3 changes: 1 addition & 2 deletions resources/views/fields/quill.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<div class="ql-editor" :id="$id('quill')" style="height: auto;">{!! $value ?? '' !!}</div>

<x-moonshine::form.textarea
:attributes="$element->attributes()->merge([
:attributes="$attributes->merge([
'class' => 'ql-textarea',
'name' => $element->name(),
'style' => 'display: none;'
])->except('x-bind:id')"
>{!! $value ?? '' !!}</x-moonshine::form.textarea>
Expand Down
17 changes: 11 additions & 6 deletions src/Fields/Quill.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@

namespace MoonShine\Quill\Fields;

use MoonShine\Fields\Textarea;
use MoonShine\AssetManager\Css;
use MoonShine\AssetManager\Js;
use MoonShine\UI\Fields\Textarea;

final class Quill extends Textarea
{
protected string $view = 'moonshine-quill::fields.quill';

protected array $assets = [
'vendor/moonshine-quill/css/quill.snow.css',
'vendor/moonshine-quill/js/quill.js',
'vendor/moonshine-quill/js/quill-init.js',
];
public function getAssets(): array
{
return [
Css::make('vendor/moonshine-quill/css/quill.snow.css'),
Js::make('vendor/moonshine-quill/js/quill.js'),
Js::make('vendor/moonshine-quill/js/quill-init.js'),
];
}
}

0 comments on commit 2b50808

Please sign in to comment.