You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, you might want to paste content from your clipboard as plain text, removing any HTML tags.
10
+
11
+
By default, CKEditor preserves the structure of the original content and ensures HTML is safely maintained. However, if you’d prefer to paste content without any formatting, as plain text, you can use the `forcePasteAsPlainText` function.
12
+
13
+
14
+
15
+
```php
16
+
use Mostafaznv\NovaCkEditor\CkEditor;
17
+
18
+
class Article extends Resource
19
+
{
20
+
public function fields(Request $request): array
21
+
{
22
+
return [
23
+
CkEditor::make(trans('Content'), 'content')
24
+
->forcePasteAsPlainText()
25
+
];
26
+
}
27
+
}
28
+
```
29
+
30
+
{% hint style="info" %}
31
+
This feature has been available since <markstyle="color:red;">v7.5.0</mark>
For certain cases, you may want to paste content from your clipboard as plain text, stripping away any HTML tags.
10
+
11
+
By default, when pasting content into the editor, CKEditor will try to maintain the original content’s structure and keep the HTML in a safe way. However, if you’d prefer to paste content without any formatting and only as plain text, you can set <markstyle="color:red;">`toolbars.toolbar-1.force-paste-as-plain-text`</mark> to <markstyle="color:red;">`true`</mark> in the configuration.
12
+
13
+
14
+
15
+
{% hint style="info" %}
16
+
This feature has been available since <markstyle="color:red;">v7.5.0</mark>
#### 3. Prepare the migration, configurations and models
37
37
38
-
After publishing stubs, essential `Image`, `Video`and `Audio` classes will be created in the `app/Models` and `app/Nova/Resources` directories respectively. These classes are used for the `media-picker` in the CKEditor field.
38
+
After publishing stubs, essential `Image`, `Video`, `Audio`and `File` classes will be created in the `app/Models` and `app/Nova/Resources` directories respectively. These classes are used for the `media-picker` in the CKEditor field.
39
39
40
40
{% tabs %}
41
41
{% tab title="Image" %}
@@ -109,8 +109,30 @@ If you wish to modify the disk name, remember to update it in the `App\Nova\Reso
109
109
{% endhint %}
110
110
{% endtab %}
111
111
112
+
{% tab title="File" %}
113
+
You should create a disk in`config/filesystems.php`:
114
+
115
+
```php
116
+
'disks' => [
117
+
'file' => [
118
+
'driver' => 'local',
119
+
'root' => public_path('uploads/file'),
120
+
'url' => env('APP_URL') . '/uploads/file',
121
+
]
122
+
]
123
+
```
124
+
125
+
{% hint style="info" %}
126
+
If you wish to modify the disk name, remember to update it in the `App\Nova\Resources\File` class as well. The third argument of the make functionin the FileUpload field corresponds to the disk name.
127
+
{% endhint %}
128
+
129
+
{% hint style="info" %}
130
+
This feature was introduced in version <mark style="color:red;">7.3.0</mark> of the NovaCKEditor
131
+
{% endhint %}
132
+
{% endtab %}
133
+
112
134
{% tab title="Migration" %}
113
-
**If you have chosen Larupload**, there is no need to make any changes to the migration file. You can refer to the [nova-video](https://github.com/mostafaznv/nova-video) and [larupload](https://github.com/mostafaznv/larupload) documentations for additional configuration options.
135
+
**If you have chosen Larupload**, there is no need to make any changes to the videos migration file. You can refer to the [nova-video](https://github.com/mostafaznv/nova-video) and [larupload](https://github.com/mostafaznv/larupload) documentations for additional configuration options.
114
136
115
137
**If you have chosen Laravel's file system**, you must make some changes to the migration file. In the migration file, replace the <mark style="color:red;">upload column</mark> with a <mark style="color:red;">string column</mark>.
116
138
@@ -134,7 +156,7 @@ class CreateVideosTable extends Migration
134
156
{% endtab %}
135
157
136
158
{% tab title="Model" %}
137
-
**If you have chosen Larupload**, there is no need to make any changes to the model. You can refer to the [nova-video](https://github.com/mostafaznv/nova-video) and [larupload](https://github.com/mostafaznv/larupload) documentations for additional configuration options.
159
+
**If you have chosen Larupload**, there is no need to make any changes to the `Video` model. You can refer to the [nova-video](https://github.com/mostafaznv/nova-video) and [larupload](https://github.com/mostafaznv/larupload) documentations for additional configuration options.
138
160
139
161
**If you have chosen Laravel's file system**, you must make some changes to the model. Remove the Larupload <mark style="color:red;">trait</mark> and the <mark style="color:red;">attachments function</mark> from the model.
0 commit comments