backpack中ckeditor是pro版本才有的组件,只能自己手动集成,以下是示例代码。

 

{{-- load the view from the application if it exists, otherwise load the one in the package --}}

            <input type="hidden" class="form-control" name="id" value="{{ $crud->fields()['id']['value'] }}" />

            <div class="mb-3">

                <label class="form-label">Title</label>

                <input type="text" class="form-control" name="title" value="{{ $crud->fields()['title']['value'] }}" />

            </div>

            <textarea name="content" id="editor">

            {{ $crud->fields()['content']['value'] }}

            </textarea>

            {{-- This makes sure that all field assets are loaded. --}}

以下是JavaScript引入ckeditor部分

<script src="/assets/ckeditor5-build-classic-38.1.1/ckeditor5-build-classic/ckeditor.js"></script>

<script>

    ClassicEditor

        .create(document.querySelector('#editor'))

        .catch(error => {

            console.error(error);

        });

</script>