$(".editor").each(function () { let id = $(this).attr('id'); ClassicEditor .create(document.querySelector('#'+id), {
toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote','imageUpload' ],
ckfinder: {
// Upload the images to the server using the CKFinder QuickUpload command.
headers: {
tokenUrl: '{$csrf_token}'
},
uploadUrl: '/admin/settings/ajax-upload-photo',
},
heading: {
options: [
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }
]
},
})
.then(function (editor) {
console.log(editor);
})
.catch(function (error) {
console.error(error);
});
});
please use csrf() in your html form
or