Field Management

Remove field

The built-in map and editor fields requires the front-end files via cdn, and if there are problems with the network, they can be removed in the following ways

Locate the file app/Admin/bootstrap.php. If the file does not exist, update Ezadev-admin and create this file.

<?php

use Ezadev\Admin\Form;

Form::forget('map');
Form::forget('editor');

// or

Form::forget(['map', 'editor']);

This removes the two fields, which can be used to remove the other fields.

Extend the custom field

Extend a PHP code editor based on codemirrorarrow-up-right with the following steps.

see PHP modearrow-up-right.

Download and unzip the codemirrorarrow-up-right library to the front-end resource directory, for example, in the directory public/packages/codemirror-5.20.2.

Create a new field class app/Admin/Extensions/PHPEditor.php:

Static resources in the class can also be imported from outside, see Editor.php

Create a view file resources/views/admin/php-editor.blade.php:

Finally, find the file app/Admin/bootstrap.php, if the file does not exist, update Ezadev-admin, and then create this file, add the following code:

And then you can use PHP editor in model-formarrow-up-right:

In this way, you can add any form fields you want to add.

Integrate CKEditor

Here is another example to show you how to integrate ckeditor.

At first download CKEditorarrow-up-right, unzip to public directory, for example public/packages/ckeditor/.

Then Write Extension class app/Admin/Extensions/Form/CKEditor.php:

Add blade file resources/views/admin/ckeditor.blade.php for view admin.ckeditor :

Register this extension in app/Admin/bootstrap.php:

After this you can use ckeditor in your form:

Last updated