Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions 7.x/crud-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,21 @@ Show a thumbnail image stored in the db column as `base64` image string.

<hr>

<a name="code_mirror_editor"></a>
### Code Mirror (Code editor) <span class="badge badge-pill badge-info">PRO</span>

Show a preview of the code stored in the database, with a "View" button to show the full code in accordeon style (hidden div).

```php
[
'name' => 'code',
'type' => 'code_mirror_editor',
'label' => 'Code',
],
```

<hr>

<a name="date_picker"></a>
### date_picker <span class="badge badge-pill badge-info">PRO</span>

Expand Down
25 changes: 25 additions & 0 deletions 7.x/crud-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,31 @@ Input preview:

<hr>

<a name="code_mirror_editor"></a>
### Code Mirror (Code Editor) <span class="badge badge-pill badge-info">PRO</span>

Show a CodeMirror code editor. It supports syntax highlighting for multiple languages and themes.

```php
CRUD::field([
'name' => 'code',
'type' => 'code_mirror_editor',
'label' => 'Code',
// optional
'configuration' => [
'theme' => 'monokai', // options: monokai, dracula, material, eclipse, idea
'mode' => 'javascript', // options: javascript, xml, css, htmlmixed, php, sql, python
'height' => '300px',
]
]);
```

Input preview:

![CRUD Field - code_mirror_editor](https://backpackforlaravel.com/uploads/docs-4-2/fields/code_mirror_editor.png)

<hr>

<a name="date-range"></a>
### date_range <span class="badge badge-pill badge-info">PRO</span>

Expand Down