//YourAnyModel.php
// Import the trait
use AnimalInstinct\LaravelBackpackEditorJs\app\Models\Traits\HasEditorJsFields;
// Use it in the model
use HasEditorJsFields;
// Declare the fields
protected $editorJsFields = ['description','anyfield'];
//YourAnyCrudController.php
use AnimalInstinct\LaravelBackpackEditorJs\app\Http\Controllers\Traits\EditorJsField;
use EditorJsField;
$this->crud->addField([
'name' => 'description',
'label' => 'Description',
'type' => EditorJsField::withBackup($this->crud->getCurrentEntry(), 'description', 'ckeditor'),
]);
bash
php artisan backpack-editorjs:install
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.