您的视图包含 post_content 字段(文本区域)的 2 个名称属性。请检查。
你可以这样做-
{!! Form::textarea('tc', $tc,array('required', 'class'=>'form-control', placeholder'=>'Your message')) !!}
然后你必须初始化它
$(document).ready(function () {
CKEDITOR.replace( 'tc' );
});
文档有清晰的示例。
在你的 Blade 中你应该像这样添加 ckeditor:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A Simple Page with CKEditor</title>
<!-- Make sure the path to CKEditor is correct. -->
<script src="../ckeditor.js"></script>
</head>
<body>
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'editor1' );
</script>
</form>
</body>
</html>
因此 javascript 代码会触发编辑器中文本区域的替换
现在是检索数据部分
<script>
var data = CKEDITOR.instances.editor1.getData();
// Your code to save "data", usually through Ajax.
</script>
如果您想通过 Ajax 发送此数据,您需要创建一个端点。不要忘记添加 CSRF 令牌
正如@user3888958所提到的,