1.composer require stevenyangecho/laravel-u-editor //通過composer安裝;
2.config/app.php 裏面添加 ‘Stevenyangecho\UEditor\UEditorServiceProvider
’;
3. php artisan vendor:publish --??
頁面中使用:
@include('UEditor::head');
<!-- 加載編輯器的容器 -->
<script id="container" name="content" type="text/plain">
這裏寫你的初始化內容
</script>
<!-- 實例化編輯器 -->
<script type="text/javascript">
var ue = UE.getEditor('container');
ue.ready(function() {
ue.execCommand('serverparam', '_token', '{{ csrf_token() }}');//此處爲支持laravel5 csrf ,根據實際情況修改,目的就是設置 _token 值.
});
</script>
接下來使用上傳圖片報錯--打開phpinfo擴展解決問題。